#!/bin/csh -fx
set id=`cat tmp0.txt`
echo $id
if ("$id" == "700000") then
echo "Good Morning"
endif
if ("$id" == "700002") then
echo "Good evening"
endif
My output from terminal
set id=`cat tmp0.txt`
cat tmp0.txt
echo 700000
700000
== 700000 ) then
== 700002 ) then
Seems like the IF is not working. Is there anything wrong with my variable?
700000\r is not equal to 700000. DOS files mess up a lot of things in UNIX.
Learn about the dos2unix command. All windows based editors "like" \r and do not display it.