mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 08:57:57 +00:00
further optimizations, branch one testing
This commit is contained in:
parent
783c9b04c2
commit
4ae6833512
15
inxi
15
inxi
|
@ -3,7 +3,7 @@
|
|||
#### Script Name: inxi
|
||||
#### Version: 2.0.0
|
||||
#### Date: 2014-03-12
|
||||
#### Patch Number: 02-b1
|
||||
#### Patch Number: 03-b1
|
||||
########################################################################
|
||||
#### SPECIAL THANKS
|
||||
########################################################################
|
||||
|
@ -2613,6 +2613,7 @@ show_options()
|
|||
}
|
||||
|
||||
# uses $COLUMNS global in terminal to set width using $LINE_MAX_BASIC
|
||||
# IMPORTANT: minimize use of subshells here or the output is too slow
|
||||
# args: $1 - 0 1 2 3 4 for indentation level; $2 -line starter, like -m; $3 - content of block.
|
||||
print_lines_basic()
|
||||
{
|
||||
|
@ -2693,6 +2694,7 @@ print_lines_basic()
|
|||
# bash loop is so slow, only run this if required
|
||||
# temp_count=$( wc -c <<< $3 )
|
||||
temp_count=${#3}
|
||||
# line_count=1000
|
||||
if [[ $temp_count -gt $line_count ]];then
|
||||
for word in $3
|
||||
do
|
||||
|
@ -2712,12 +2714,8 @@ print_lines_basic()
|
|||
line_starter="$line_x_starter"
|
||||
fi
|
||||
# clean up forced connections, ie, stuff we don't want wrapping
|
||||
# it's slightly more efficient to echo than strip out start/end spaces with sed
|
||||
# print_string=$( sed 's/\^/ /g' <<< $print_string | sed 's/^[[:space:]]|[[:space:]]$//g' )
|
||||
#print_string=$( echo $print_string | sed 's/\^/ /g' )
|
||||
print_string=$( sed 's/\^/ /g' <<< $print_string )
|
||||
print_string=${print_string//^/}
|
||||
print_screen_output "$line_starter$print_string"
|
||||
#echo "$line_starter$print_string"
|
||||
print_string="$word$spacer" # needed to handle second word on new line
|
||||
temp_string=''
|
||||
spacer=''
|
||||
|
@ -2735,11 +2733,8 @@ print_lines_basic()
|
|||
else
|
||||
line_starter="$line_x_starter"
|
||||
fi
|
||||
# print_string=$( sed 's/\^/ /g' <<< $print_string | sed 's/^[[:space:]]|[[:space:]]$//g' )
|
||||
#print_string=$( echo $print_string | sed 's/\^/ /g' )
|
||||
print_string=$( sed 's/\^/ /g' <<< $print_string )
|
||||
print_string=${print_string//^/}
|
||||
print_screen_output "$line_starter$print_string"
|
||||
#echo "$line_starter$print_string"
|
||||
fi
|
||||
}
|
||||
# print_lines_basic '1' '-m' 'let us teest this string and lots more and stuff and more stuff and x is wy and z is x and fred is dead and gus is alive an yes we have to go now'
|
||||
|
|
Loading…
Reference in a new issue