01-20-2009
Execute while loop
Hi,
I have a background process running for which I want to know the status continuously.
I want to execute a WHILE loop in the command prompt so that it keeps on displaying in the screen.But, I am getting the following errors :-
hyper20:~ 3> while [1]
while?
while?
hyper20:~ 4> while {1}
while?
while?
hyper20:~ 5> while [ 1 ]
while: Expression Syntax.
Could someone please help me in this ?
Thanks.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
please can someone point me in the right direction with a shell scripting problem.
I want to execute a command in a for loop and the command should be started not one-by-one meaning the for loop is waiting for the exit code , it should be started in parallel.
I have a plain text file... (3 Replies)
Discussion started by: networkfre@k
3 Replies
2. Shell Programming and Scripting
I have a very basic bash shell script, which has many "while... done; for .... done" loop clauses, like the following
~~
#!/bin/bash
while blablalba; do
....
done < /tmp/file
for line in `cat blablabla`; do grep $line /tmp/raw ; done > /tmp/1;
while blablalba2; do
....
done <... (2 Replies)
Discussion started by: fedora
2 Replies
3. UNIX for Dummies Questions & Answers
I want to execute a while loop (or any other loop) for 20 minutes.
I have extracted the minutes and seconds from the current system date by using the command y = `date +%M%S`
How to proceed ?? (6 Replies)
Discussion started by: subhotech
6 Replies
4. Shell Programming and Scripting
hi Everyone , have a nice day
#!/bin/sh
( sleep 1
echo "LOGIN:username:password;"
sleep 1
while IFS= read -r line
do
#echo $line
GET:VOUCHERDETAIL:VoucherSerialNumber,$line; >> /home/status_log
done < /home/status.txt
sleep 1
echo "LOGOUT;") | telnet 127.0.0.1 7021
,
it... (2 Replies)
Discussion started by: Dastard
2 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I have a set of input data that I split into batches using the following command:
split -l 4000000 MyInput.in Split_a
Once I get the split files, I run a certain command on the split files that spews an output. So far I have been doing it without a for loop. How can I translate the... (2 Replies)
Discussion started by: Gussifinknottle
2 Replies
6. UNIX for Dummies Questions & Answers
Hi everyone.
I wanted to print numbers from 1 to 5 in reverse order. For this I used the following code:
#!/bin/bash
x=5
while
do
echo $x
x=`expr $x - 1`
echo ""
done
echo ""
Well but on compiling the above code, it gives the following error.
... (3 Replies)
Discussion started by: grc
3 Replies
7. Shell Programming and Scripting
HI Unix Gurus,
I have a number of SELECT count(*) statements in an input file and I want to execute it using a shell script but one by one using loop in script....
How can I do this..... (7 Replies)
Discussion started by: ustechie
7 Replies
8. Shell Programming and Scripting
I have a below command
ALTER TABLE `abc` ADD PARTITION ( PARTITION 20130613 VALUES less than (DAY('13')));
Below is requirement
It runs in Loop
as DAY start with 13 and end with 100 along with this of counter "20130613" also increases per command
as the next command should be
... (8 Replies)
Discussion started by: kaushik02018
8 Replies
9. Shell Programming and Scripting
How do we execute a command inside a while loop? (7 Replies)
Discussion started by: Little
7 Replies
10. Shell Programming and Scripting
Hi,
I have first script which on IR remote command event execute the second script. If the second script is executed, it display echo "timeout expired" after 10s. This works as expected.
But I also want to reset timer (increase time) in case if the second script is executed again within 10s.
... (8 Replies)
Discussion started by: armatron
8 Replies
LEARN ABOUT ULTRIX
timedc
timedc(8) System Manager's Manual timedc(8)
Name
timedc - timed control program
Syntax
/usr/etc/timedc [ command [ argument ...]]
Description
The program controls the operation of the daemon. If you run without any arguments, enters interactive mode and displays the prompt.
If you supply a command on the command line, runs the command and then exits. If you redirect the standard input of from an interactive
terminal to a file, interprets the contents of the file as a list of commands separated by carriage returns and terminated with an EOF
character.
Commands
?[command...]
help[command...] Prints a short description of each command specified in the argument list. If no arguments are given, a list of the
recognized commands is printed.
clockdiff[host...] Computes the differences between the clock of the host machine and the clocks of the machines given as arguments.
trace[ on | off ] Enables or disables the logging of incoming messages to The command logs messages in the file
[ incr | decr ] [ -cd ][minutes:][seconds.][microseconds]
Increments or decrements the value of the local clock so that the clock gains or loses the specified amount of time.
-c Adjusts the local clock continuously. Adjustments specified with the switch should be on the order of
microseconds, and are added or subtracted from the local clock in small stages. This type of adjustment
avoids large instantaneous jumps and guarantees that the graph of local clock time versus real time remains
continuous.
The following example increments the local clock continuously by 500 microseconds: /etc/timedc incr -c 500
-d Adjusts the local clock instantaneously. Adjustments specified with the switch should be on the order of
seconds, and are added or subtracted from the local clock at once. The graph of local clock time versus real
time is discontinuous.
The following example decrements the local clock discontinuously by five minutes and two seconds: /etc/timedc
decr -d 5:2
msite Indicates which site the master is running on currently.
quit Exits from the program.
Diagnostics
?Ambiguous command
Abbreviation matches more than one command.
?Invalid command
No match was found.
?Privileged command
Command can be executed by root only.
Files
Tracing file for
Log file for master
See Also
date(1), adjtime(2), settimeofday(2), timed(8)
timedc(8)