Made all awk code endings the same, }' )... in all cases, or }' /file/path, or whatever

This commit is contained in:
inxi-svn 2008-11-06 21:39:18 +00:00
parent fe2fdf78e5
commit fd5ca8a6e2

61
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 0.3.27 #### version: 0.3.28
#### Date: November 6 2008 #### Date: November 6 2008
######################################################################## ########################################################################
#### inxi is a fork of infobash, the original bash sys info script by locsmif #### inxi is a fork of infobash, the original bash sys info script by locsmif
@ -204,34 +204,26 @@ error_handler()
# assemble the error message # assemble the error message
case $1 in case $1 in
2) 2) error_message="large flood danger, debug buffer full!"
error_message="$SCRIPT_NAME: large flood danger, debug buffer full!"
;; ;;
3) 3) error_message="unsupported color scheme number: $2"
error_message="$SCRIPT_NAME: unsupported color scheme number: $2"
;; ;;
4) 4) error_message="unsupported verbosity level: $2"
error_message="$SCRIPT_NAME: unsupported verbosity level: $2"
;; ;;
5) 5) error_message="dependency not met: $2 not found in path"
error_message="$SCRIPT_NAME: dependency not met: $2 not found in path"
;; ;;
6) 6) error_message="/proc not found! Quitting..."
error_message="$SCRIPT_NAME: /proc not found! Quitting..."
;; ;;
7) 7) error_message="unknown parameter: $2"
error_message="$SCRIPT_NAME: unknown parameter: $2"
;; ;;
8) 8) error_message="the self-updater failed, wget exited with error: $2.\nYou probably need to be root.\nHint, to make for easy updates without being root, do: chown <user name> $SCRIPT_NAME"
error_message="$SCRIPT_NAME: the self-updater failed, wget exited with error: $2.\nYou probably need to be root.\nHint, to make for easy updates without being root, do: chown <user name> $SCRIPT_NAME"
;; ;;
*) *) error_message="error unknown: $@"
error_message="$SCRIPT_NAME: error unknown: $@"
set -- 99 set -- 99
;; ;;
esac esac
# then print it and exit # then print it and exit
print_screen_output "$error_message" print_screen_output "$SCRIPT_NAME: $error_message"
exit $1 exit $1
} }
@ -674,8 +666,7 @@ get_start_client()
sub(/bitchx-/,"",a) sub(/bitchx-/,"",a)
print a print a
exit exit
} }' )"
' )"
IRC_CLIENT="BitchX" IRC_CLIENT="BitchX"
;; ;;
*ircii*) *ircii*)
@ -923,8 +914,7 @@ get_cpu_data()
else { else {
printf("%s %s\n", max, "Mhz") printf("%s %s\n", max, "Mhz")
} }
} }' /proc/cpuinfo))
' /proc/cpuinfo))
IFS="$ORIGINAL_IFS" IFS="$ORIGINAL_IFS"
} }
@ -1004,8 +994,7 @@ get_graphics_card_data()
gsub(/^ +| +$/, "", $NF) gsub(/^ +| +$/, "", $NF)
gsub(/ [ \t]+/, " ", $NF) gsub(/ [ \t]+/, " ", $NF)
print $NF print $NF
}' }' ) )
) )
IFS="$ORIGINAL_IFS" IFS="$ORIGINAL_IFS"
# for (( i=0; i < ${#A_GFX_CARD_DATA[@]}; i++ )) # for (( i=0; i < ${#A_GFX_CARD_DATA[@]}; i++ ))
# do # do
@ -1053,8 +1042,7 @@ get_graphics_glx_data()
END { END {
printf("%s\n%s\n%s\n", join(a,", "), join(b,", "), join(c,", ")) printf("%s\n%s\n%s\n", join(a,", "), join(b,", "), join(c,", "))
} }' ) )
' ) )
IFS="$ORIGINAL_IFS" IFS="$ORIGINAL_IFS"
# GLXR=$(glxinfo | gawk -F ': ' 'BEGIN {IGNORECASE=1} /opengl renderer/ && $2 !~ /mesa/ {seen[$2]++} END {for (i in seen) {printf("%s ",i)}}') # GLXR=$(glxinfo | gawk -F ': ' 'BEGIN {IGNORECASE=1} /opengl renderer/ && $2 !~ /mesa/ {seen[$2]++} END {for (i in seen) {printf("%s ",i)}}')
@ -1079,9 +1067,7 @@ get_graphics_res_data()
} }
if (line) if (line)
print(line) print(line)
} }' )
' )
if [[ -z $screen_resolution ]];then if [[ -z $screen_resolution ]];then
screen_resolution=$( xdpyinfo | gawk '/dimensions/ { print $2 }' ) screen_resolution=$( xdpyinfo | gawk '/dimensions/ { print $2 }' )
fi fi
@ -1128,8 +1114,7 @@ get_graphics_x_data()
gsub(/0+$/, "", $2) gsub(/0+$/, "", $2)
gsub(/0+/, ".", $2) gsub(/0+/, ".", $2)
print $2 print $2
} }' )
')
fi fi
A_X_DATA[0]="$x_vendor" A_X_DATA[0]="$x_vendor"
A_X_DATA[1]="$x_version" A_X_DATA[1]="$x_version"
@ -1187,8 +1172,7 @@ get_hard_drive_data()
print c print c
} }
} }
} }' /proc/scsi/scsi))
' /proc/scsi/scsi))
IFS="$ORIGINAL_IFS" IFS="$ORIGINAL_IFS"
## note: the output part of this should be in the print hdd data function, not here ## note: the output part of this should be in the print hdd data function, not here
@ -1236,8 +1220,9 @@ get_hard_drive_data()
} }
} }
/^Filesystem/ { p++ } /^Filesystem/ { p++ }
END { print c } END {
' ) print c
}' )
hdd_used="$((hdd_used*100/hdd_capacity))% used" hdd_used="$((hdd_used*100/hdd_capacity))% used"
hdd_capacity="$(($hdd_capacity*1024/1000**3))GB" hdd_capacity="$(($hdd_capacity*1024/1000**3))GB"
else else
@ -1317,8 +1302,7 @@ get_networking_data()
print a[j] "," usePorts print a[j] "," usePorts
j++ j++
} }
} }') )
') )
IFS="$ORIGINAL_IFS" IFS="$ORIGINAL_IFS"
} }
@ -1412,8 +1396,7 @@ process_cpu_flags()
} }
} }
print s print s
} }' )
' )
#grep -oE '\<(nx|lm|sse[0-9]?|pni|svm|vmx)\>' | tr '\n' ' ')) #grep -oE '\<(nx|lm|sse[0-9]?|pni|svm|vmx)\>' | tr '\n' ' '))
if [[ -z $cpu_flags ]];then if [[ -z $cpu_flags ]];then