Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Shell script doubt

$
0
0
Hi all,

can you plz check whether the below code is correct & some inputs.
I need to read the below file and process it.

input :

Code:


/home/ibm/var.txt
 
urgent
not urgent
not needed.

Code:


#!/usr/bin/ksh
VAR=/home/ibm/var.txt
if [[ -s $VAR ]]
then
cat $VAR | while read VAR
do
if [[ $VAR = 'urgent' ]
then
echo "process";
else
echo "not process";
fi
done


Viewing all articles
Browse latest Browse all 16232

Trending Articles