Sponsored Content
Full Discussion: Execute while loop
Top Forums UNIX for Advanced & Expert Users Execute while loop Post 302278383 by shubhranshu on Tuesday 20th of January 2009 05:17:48 AM
Old 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

Execute commands parallel in a for loop ?

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

loop does not execute in bash script?

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

how to execute a while loop for 20 minutes?

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

Execute Loop in Telnet

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

For Loop to execute a command on a series of files

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

unable to execute while loop

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

How to execute a no of SELECT COUNT(*) statements using a loop

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

Execute command with loop

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 to execute a command inside a while loop?

How do we execute a command inside a while loop? (7 Replies)
Discussion started by: Little
7 Replies

10. Shell Programming and Scripting

Exit while loop on execute script

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
XNLOCK(1)						      General Commands Manual							 XNLOCK(1)

NAME
xnlock - amusing lock screen program with message for passers-by SYNOPSIS
xnlock [ options ] [ message ] DESCRIPTION
xnlock is a program that acts as a screen saver for workstations running X11. It also "locks" the screen such that the workstation can be left unattended without worry that someone else will walk up to it and mess everything up. When xnlock is running, a little man with a big nose and a hat runs around spewing out messages to the screen. By default, the messages are "humorous", but that depends on your sense of humor. If a key or mouse button is pressed, a prompt is printed requesting the user's password. If a RETURN is not typed within 30 seconds, the little man resumes running around. Text on the command line is used as the message. For example: % xnlock I'm out to lunch for a couple of hours. Note the need to quote shell metacharacters. In the absence of flags or text, xnlock displays random fortunes. OPTIONS
Command line options override all resource specifications. All arguments that are not associated with a command line option is taken to be message text that the little man will "say" every once in a while. The resource xnlock.text may be set to a string. -fn fontname The default font is the first 18 point font in the new century schoolbook family. While larger fonts are recokmmended over smaller ones, any font in the server's font list will work. The resource to use for this option is xnlock.font. -filename filename Take the message to be displayed from the file filename. If filename is not specified, $HOME/.msgfile is used. If the contents of the file are changed during runtime, the most recent text of the file is used (allowing the displayed message to be altered remotely). Carriage returns within the text are allowed, but tabs or other control characters are not translated and should not be used. The resource available for this option is xnlock.file. -ar Accept root's password to unlock screen. This option is true by default. The reason for this is so that someone's screen may be unlocked by autorized users in case of emergency and the person running the program is still out to lunch. The resource available for specifying this option is xnlock.acceptRootPasswd. -noar Don't accept root's password. This option is for paranoids who fear their peers might breakin using root's password and remove their files anyway. Specifying this option on the command line overrides the xnlock.acceptRootPasswd if set to True. -ip Ignore password prompt. The resource available for this option is xnlock.ignorePasswd. -noip Don't ignore password prompt. This is available in order to override the resource ignorePasswd if set to True. -fg color Specifies the foreground color. The resource available for this is xnlock.foreground. -bg color Specifies the background color. The resource available for this is xnlock.background. -rv Reverse the foreground and background colors. The resource for this is xvnlock.reverseVideo. -norv Don't use reverse video. This is available to override the reverseVideo resource if set to True. -prog program Receive message text from the running program program. If there are arguments to program, encase them with the name of the program in quotes (e.g. xnlock -t "fortune -o"). The resource for this is xnlock.program. RESOURCES
xnlock.font: fontname xnlock.foreground: color xnlock.background: color xnlock.reverseVideo: True/False xnlock.text: Some random text string xnlock.program: program [args] xnlock.ignorePasswd: True/False xnlock.acceptRootPasswd: True/False FILES
xnlock executable file ~/.msgfile default message file AUTHOR
Dan Heller <argv@sun.com> Copyright (c) 1985, 1990. The original version of this program was written using pixrects on a Sun 2 running SunOS 1.1. 19 April 1990 XNLOCK(1)
All times are GMT -4. The time now is 02:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy