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
########################################################################
#### Script Name: inxi
#### version: 0.3.27
#### version: 0.3.28
#### Date: November 6 2008
########################################################################
#### inxi is a fork of infobash, the original bash sys info script by locsmif
@ -204,34 +204,26 @@ error_handler()
# assemble the error message
case $1 in
2)
error_message="$SCRIPT_NAME: large flood danger, debug buffer full!"
2) error_message="large flood danger, debug buffer full!"
;;
3)
error_message="$SCRIPT_NAME: unsupported color scheme number: $2"
3) error_message="unsupported color scheme number: $2"
;;
4)
error_message="$SCRIPT_NAME: unsupported verbosity level: $2"
4) error_message="unsupported verbosity level: $2"
;;
5)
error_message="$SCRIPT_NAME: dependency not met: $2 not found in path"
5) error_message="dependency not met: $2 not found in path"
;;
6)
error_message="$SCRIPT_NAME: /proc not found! Quitting..."
6) error_message="/proc not found! Quitting..."
;;
7)
error_message="$SCRIPT_NAME: unknown parameter: $2"
7) error_message="unknown parameter: $2"
;;
8)
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"
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: error unknown: $@"
*) error_message="error unknown: $@"
set -- 99
;;
esac
# then print it and exit
print_screen_output "$error_message"
print_screen_output "$SCRIPT_NAME: $error_message"
exit $1
}
@ -674,8 +666,7 @@ get_start_client()
sub(/bitchx-/,"",a)
print a
exit
}
' )"
}' )"
IRC_CLIENT="BitchX"
;;
*ircii*)
@ -923,8 +914,7 @@ get_cpu_data()
else {
printf("%s %s\n", max, "Mhz")
}
}
' /proc/cpuinfo))
}' /proc/cpuinfo))
IFS="$ORIGINAL_IFS"
}
@ -1004,8 +994,7 @@ get_graphics_card_data()
gsub(/^ +| +$/, "", $NF)
gsub(/ [ \t]+/, " ", $NF)
print $NF
}'
) )
}' ) )
IFS="$ORIGINAL_IFS"
# for (( i=0; i < ${#A_GFX_CARD_DATA[@]}; i++ ))
# do
@ -1053,8 +1042,7 @@ get_graphics_glx_data()
END {
printf("%s\n%s\n%s\n", join(a,", "), join(b,", "), join(c,", "))
}
' ) )
}' ) )
IFS="$ORIGINAL_IFS"
# 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)
print(line)
}
' )
}' )
if [[ -z $screen_resolution ]];then
screen_resolution=$( xdpyinfo | gawk '/dimensions/ { print $2 }' )
fi
@ -1128,8 +1114,7 @@ get_graphics_x_data()
gsub(/0+$/, "", $2)
gsub(/0+/, ".", $2)
print $2
}
')
}' )
fi
A_X_DATA[0]="$x_vendor"
A_X_DATA[1]="$x_version"
@ -1187,8 +1172,7 @@ get_hard_drive_data()
print c
}
}
}
' /proc/scsi/scsi))
}' /proc/scsi/scsi))
IFS="$ORIGINAL_IFS"
## 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++ }
END { print c }
' )
END {
print c
}' )
hdd_used="$((hdd_used*100/hdd_capacity))% used"
hdd_capacity="$(($hdd_capacity*1024/1000**3))GB"
else
@ -1317,8 +1302,7 @@ get_networking_data()
print a[j] "," usePorts
j++
}
}
') )
}') )
IFS="$ORIGINAL_IFS"
}
@ -1412,8 +1396,7 @@ process_cpu_flags()
}
}
print s
}
' )
}' )
#grep -oE '\<(nx|lm|sse[0-9]?|pni|svm|vmx)\>' | tr '\n' ' '))
if [[ -z $cpu_flags ]];then