06-11-2009
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
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
Is there any way to get current time for a particular country using any unix command ?
I mean, If i want to find out current time in US or UK or anything ....
Any command or library routine available for that?
How it can be done in C on Unix?
Can anybody help me?
Thanks
--... (1 Reply)
Discussion started by: kamlakar
1 Replies
2. Filesystems, Disks and Memory
I have a pentium scsi with unix installed. It used to be a workstation in my former workplace. I'd like to install windows for my sons use but don't know unix and it's pw protected (don't know the pw). How can unix be deleted and windows put on? (2 Replies)
Discussion started by: misc19432043
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I am using HPUX 11. There is a command to convert Unix formatted data to Dos formatted data called 'ux2dos'.
Is there a similar command to convert Unix formatted data to EBCDIC format?
Many thanks
Helen :) (2 Replies)
Discussion started by: Bab00shka
2 Replies
4. Shell Programming and Scripting
Hi !
I need to convert a DOS batch file to Unix Shell script. Can anybody help me by providing equivalent Unix shell script code to this DOS batch code?.
for /F "tokens=2,3,4 delims=/- " %%i in ("%date%") do set DateStamp=%%k%%i%%j
Any help would be great.
Thanks,
John. (1 Reply)
Discussion started by: john413
1 Replies
5. Shell Programming and Scripting
Hey guys,
Im looking to convert the following script into batch language for windows / DOS but my knowledge of batch syntax is nill - but i have good knowledge of UNIX shell...can anyone help?
#!/bin/sh
if ; then
echo "UNCERTAIN:"
echo "Too few arguments"
echo "Usage: file_exists... (3 Replies)
Discussion started by: kiwi_bloke
3 Replies
6. Shell Programming and Scripting
Dear All
Could you please advice how do we convert a unix file to dos
I know one command,ux2dos, which somehow does not work to give desired output
Inputs on this is appreciated
Thanks,
Suresh (3 Replies)
Discussion started by: sureshg_sampat
3 Replies
7. Shell Programming and Scripting
Hi,
Please help me in implemeting unix2dos command so that report output which comes as the attachment through mail is in the proper format
Am using uuencode fro attaching one report which is nothing but sql query output.
But when i receive the report through attachement and when it is... (2 Replies)
Discussion started by: weknowd
2 Replies
8. Shell Programming and Scripting
HI there !
can you please explain me about "unix2does" command like >> when we used ? what it does ? ... (3 Replies)
Discussion started by: sravan008
3 Replies
9. Shell Programming and Scripting
I'm not sure why but my script quits automatically at the point where unix2dos / dos2unix command is used. :confused::confused::confused:
How do a fix it?
LOG_FILE=MADDY.txt
unix2dos ${LOG_FILE}
exec 2> $LOG_FILE 1>&2
echo ${LOG_FILE}
The script exists after the below... (3 Replies)
Discussion started by: machomaddy
3 Replies
10. UNIX for Beginners Questions & Answers
Here is a powershell script to use restful API to create ticket in our ticketing tool. Can anyone please convert it to a shell script sothat, I can run it in Unix servers,
below is the code:
$body = @{
Customer= ''test'
Summary= 'test summary'
Impact= '4-Minor/Localized'
... (2 Replies)
Discussion started by: pandeybhavesh18
2 Replies
LEARN ABOUT FREEBSD
sleep
SLEEP(1) BSD General Commands Manual SLEEP(1)
NAME
sleep -- suspend execution for an interval of time
SYNOPSIS
sleep seconds
DESCRIPTION
The sleep command suspends execution for a minimum of seconds.
If the sleep command receives a signal, it takes the standard action. When the SIGINFO signal is received, the estimate of the amount of
seconds left to sleep is printed on the standard output.
IMPLEMENTATION NOTES
The SIGALRM signal is not handled specially by this implementation.
The sleep command allows and honors a non-integer number of seconds to sleep in any form acceptable by strtod(3). This is a non-portable
extension, and its use will nearly guarantee that a shell script will not execute properly on another system.
EXIT STATUS
The sleep utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
To schedule the execution of a command for x number seconds later (with csh(1)):
(sleep 1800; sh command_file >& errors)&
This incantation would wait a half hour before running the script command_file. (See the at(1) utility.)
To reiteratively run a command (with the csh(1)):
while (1)
if (! -r zzz.rawdata) then
sleep 300
else
foreach i (`ls *.rawdata`)
sleep 70
awk -f collapse_data $i >> results
end
break
endif
end
The scenario for a script such as this might be: a program currently running is taking longer than expected to process a series of files, and
it would be nice to have another program start processing the files created by the first program as soon as it is finished (when zzz.rawdata
is created). The script checks every five minutes for the file zzz.rawdata, when the file is found, then another portion processing is done
courteously by sleeping for 70 seconds in between each awk job.
SEE ALSO
nanosleep(2), sleep(3)
STANDARDS
The sleep command is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.
HISTORY
A sleep command appeared in Version 4 AT&T UNIX.
BSD
April 18, 1994 BSD