mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 08:57:57 +00:00
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.
This commit is contained in:
parent
f75d42d43d
commit
26e1d560c3
9
inxi
9
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: [1;34m 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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue