diff --git a/inxi b/inxi index 22a54a2..a705229 100755 --- a/inxi +++ b/inxi @@ -1,8 +1,8 @@ #!/usr/bin/env bash ######################################################################## #### Script Name: inxi -#### Version: 2.1.15 -#### Date: 2014-04-01 +#### Version: 2.1.16 +#### Date: 2014-04-02 #### Patch Number: 00 ######################################################################## #### SPECIAL THANKS @@ -521,6 +521,7 @@ C2='' CN='' ## Always leave these blank, these are only going to be set in inxi.conf files, that makes testing ## for user changes easier after sourcing the files +ESC='\x1b' GLOBAL_COLOR_SCHEME='' IRC_COLOR_SCHEME='' IRC_CONS_COLOR_SCHEME='' @@ -825,6 +826,7 @@ initialize_data() BSD_TYPE='bsd' # all other bsds SED_I="-i ''" SED_RX='-E' + ESC=$(echo | tr '\n' '\033') fi fi # now set the script BOOLEANS for files required to run features @@ -8913,7 +8915,8 @@ calculate_line_length() { local string=$1 # ansi:  irc: \x0312 - string=$( sed -e "s/\x1b\[[0-9]\{1,2\}\(;[0-9]\{1,2\}\)\{0,2\}m//g" -e "s/\\\x0[0-9]\{1,3\}//g" <<< $string ) + # note: using special trick for bsd sed, tr + string=$( sed -e 's/'$ESC'\[[0-9]\{1,2\}\(;[0-9]\{1,2\}\)\{0,2\}m//g' -e 's/\\\x0[0-9]\{1,3\}//g' <<< $string ) count=${#string} echo $count } diff --git a/inxi.changelog b/inxi.changelog index cc19cd2..c50b99f 100755 --- a/inxi.changelog +++ b/inxi.changelog @@ -1,3 +1,21 @@ +===================================================================================== +Version: 2.1.16 +Patch Version: 00 +Script Date: 2014-04-02 +----------------------------------- +Changes: +----------------------------------- +New version, tarball. This fix only impacts bsd sed, but it fixes the line length failure +issue because bsd sed doesn't work with \x1b, but it does when you do: +ESC=$(echo | tr '\n' '\033' ) +I found this trick on: +http://unix.stackexchange.com/questions/42321/how-can-i-instruct-bsd-sed-to-interpret-escape-sequences-like-n-and-t + +No other changes. Non bsd users, you can ignore this. + +----------------------------------- +-- Harald Hope - Wed, 02 Apr 2014 21:24:52 -0700 + ===================================================================================== Version: 2.1.15 Patch Version: 00