I have this problem; i cant compare the variable for Precount and Postcount
Its keep reading 0.
need help
My shell script as below,Precount=0
Postcount=0file1=/cygdrive/c/LogA.log
file2=/cygdrive/c/rLogB.logsed q $file1 > $Precount
sed q $file2 > $Postcount
echo $Precount
echo $Postcount
if [ $Precount==$Postcount ]; then
echo "No Files Missing"
else
echo " Missing Files"
sdiff $file1 $file2 |grep '<'>>/cygdrive/c/Logc.log
fithanks alot
Ok I found the mistakes
Im new to shell scripting/programming, anyhow learning from my mistakesfile1=/cygdrive/c/LogA.log
file2=/cygdrive/c/rLogB.logPrecount=`sed q $file1`
Postcount=`sed q $file2`
echo $Precount
echo $Postcount
if [ $Precount = $Postcount ]; then
echo "No Files Missing"
else
echo " Missing Files"
sdiff $file1 $file2 |grep '<'>>/cygdrive/c/Logc.log
fiCorrect me if anything wrong in above script
Thanks
i was just curious as to contents or implications of q.
(new to shell, not to mention sed/ed etc.)
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |