diff options
Diffstat (limited to 'bash/check_Cl.sh')
-rwxr-xr-x | bash/check_Cl.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/bash/check_Cl.sh b/bash/check_Cl.sh new file mode 100755 index 0000000..563e3a1 --- /dev/null +++ b/bash/check_Cl.sh @@ -0,0 +1,34 @@ +#! /bin/sh + +prefix="syscfg addbyte" +file=cl.txt + +if [[ $# -gt 2 ]]; then + echo "Incorrect argument" +elif + [[ $# -eq 2 ]]; then + file=${2}.txt +fi + +if [[ ! -f $1 ]]; then + echo "File not exists" + exit +fi + +func() { + p="$(echo $prefix $1)" + + if [ $1 == "BLCl" ]; then + echo "$(grep "${prefix} $1" "$2" | tail -n1 | tr -s '[:space:]' | rev | cut -d ' ' -f 1 | rev) insight color cal $1" >> $file + else + echo "$(grep "${prefix} $1" "$2" | head -n1 | tr -s '[:space:]' | rev | cut -d ' ' -f 1 | rev) insight pre color cal $1" >> $file + echo "$(grep "${prefix} $1" "$2" | tail -n1 | tr -s '[:space:]' | rev | cut -d ' ' -f 1 | rev) insight post color cal $1" >> $file + fi + +# echo "0x$(sysconfig read -k $1 | tr -d '[:space:]' | rev | cut -d '|' -f 1 | rev) System $1" >> $file + echo "" >> $file +} + +func "BLCl" "$1" +func "GLCl" "$1" +func "DPCl" "$1" |