code cleanup for sed for logging

This commit is contained in:
inxi-svn 2009-05-29 00:19:46 +00:00
parent 80f2f2a508
commit 7745b3c004

2
inxi
View file

@ -779,7 +779,7 @@ log_function_data()
# Create any required line breaks and strip out escape color code, either ansi (case 1)or irc (case 2).
# This pattern doesn't work for irc colors, if we need that someone can figure it out
if [[ $B_LOG_COLORS != 'true' ]];then
echo -e "${spacer}$logged_data" | sed 's/\x1b\[[0-9]\{1,2\}\(;[0-9]\{1,2\}\)\{0,2\}m//g' >> $LOG_FILE
echo -e "${spacer}$logged_data" | sed -r 's/\x1b\[[0-9]{1,2}(;[0-9]{1,2}){0,2}m//g' >> $LOG_FILE
else
echo -e "${spacer}$logged_data" >> $LOG_FILE
fi