Name: Nanda_Anu Date: September 16, 2003 at 04:07:15 Pacific Subject: To read the value of a variable OS: Win 2k CPU/Ram: P IV & 64kb
Comment:
Hi, I am facing a serious problem.Please tell me what is my mistake? My script goes like : #!/bin/ksh for file in send*.log do if[ -f ${file}] then grep "filename inside the file" ${file} >> temp grep "process number" ${file} >> temp assigning variable: set pnum=cat temp|tail-1 temp #temp has both filename & process number echo " $pnum " #has to display pnum from temp main script: set -v ndmcli EOJ select statistics pnumber=${pnum};#here above pnum value is not assigned. why this problem does it requires any conversion from file output to assign EOJ
else exit fi done
I need to execute the above statement very badly: select statistics pnumber=${pnum}; if give value user input ,it assigns. but as a file output,it doesn't assign
help me tell me what wrong i did thank u nanda_anu
There's a good thought. If no one answers your homework question immediately, post it 10 or 15 more times under different names. Hope that works out for you.
BTW you don't need to check for the existence of a file you just got from the for command.
Even after removing if statement also my variable is not assigned inside the script
Try to give solution: in order to assign the value of a variable in the following select statistics pnumber=<pnum>; my pnum value should be ex:16244 from an another file