The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 06-11-2009
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,770
Quote:
Originally Posted by karthiksrao View Post
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.