jeudi 22 août 2019

in csh if-statement giving error as "if: Badly formed number."

when i run the below code in my csh shell it is giving Error as "if: Badly formed number."

!/bin/csh

setenv KERNEL_VER uname -r

if ( "$KERNEL_VER" =="el6" ) then echo "Kernel version is OEL6" elif ( "$KERNEL_VER" == "el7" ) then echo "Kernel version is OEL7" else echo "Only OEL6 or OEL7 are supported" exit 1 fi

i OS is a OEL7 so the control should go inside the "elif" section.

Instead i am getting the below error.

if: Badly formed number.

Any help would be appreatiated

Aucun commentaire:

Enregistrer un commentaire