Quote:
Originally Posted by karthiksrao
Hi,
I am a newbie and do not have much experience using unix. But I have been trying to understand it. I found the following unix script
typeset -i n=0
decalre an integer variable n
while [! -s vel.txt] vel.txt exists and is bigger than zero bytes read man page for test
do
sleep 5
echo "${n}:Fluent is running...."
n=${n}+1
done
I have the following doubts:
1) In the first line - I am aware that we are defining a variable n and setting its value to zero. What does the '-i' do ?
2) Does the while loop say that while vel.txt does NOT exist, keep printing "Fluent is running..." ? What does the '-s' stand for?
3) I need to convert this to DOS batch script..
Is the following, a correct translation ?
I have not done DOS for 15 years. It looks reasonable except
for the {} around the n. I do not remember that.
SET n=0
WHILE NOT vel.txt
DO
SLEEP 5
ECHO "%{n}% : Fluent is running..."
n = %{n}% + 1
DONE
Any help will be much appreciated.
Thanks
|
I added some comments in red.