The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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



Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
character set conversion in unix C gucho High Level Programming 1 03-01-2008 08:27 AM
conversion from Unix to windows kiwi_bloke Shell Programming and Scripting 3 10-10-2005 01:56 PM
Dos to Unix conversion john413 Shell Programming and Scripting 1 09-10-2005 03:13 PM
Unix to EBCDIC conversion Bab00shka UNIX for Dummies Questions & Answers 2 01-20-2005 12:58 PM
Time conversion in Unix kamlakar UNIX for Advanced & Expert Users 1 04-22-2002 12:55 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-11-2009
karthiksrao karthiksrao is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 1
unix script and unix2dos conversion

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

while [! -s vel.txt]
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 ?

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
  #2 (permalink)  
Old 06-11-2009
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
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.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 07:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0