Sponsored Content
Full Discussion: Do While Loop Command help
Top Forums Shell Programming and Scripting Do While Loop Command help Post 302768549 by skrv on Friday 8th of February 2013 08:24:29 PM
Old 02-08-2013
does this look good?

Code:
while true ; do (date; netstat -antp | grep 1424 | grep -v "runmqlsr"| wc - l  ; sleep 1;) done >> test.out

---------- Post updated at 08:24 PM ---------- Previous update was at 08:18 PM ----------

this is working and writing to a file but how can i make it run in the background?

Code:
while true ; do (date; netstat -antp | grep 1424 | grep -v "runmqlsr"| wc - l  ; sleep 1;) done >> test.out


Last edited by Scrutinizer; 02-09-2013 at 01:15 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

rsh command in a while loop

Hi , reading a "file1" with 2 data in each line (VAR1 and VAR2) , i'm using a while loop like this : cat file1|awk '{print $1,$2}'|while read VAR1 VA2 do echo $VAR1 echo $VAR2 done as this example shows , it works but if between do and done i use a "rsh" command , the script reads... (6 Replies)
Discussion started by: Nicol
6 Replies

2. Shell Programming and Scripting

Pb in while loop with ssh command

Hi I use the following command to check if my_base is active or not : active_db=`${LOCAL_BIN}/ssh -l ${my_user} ${my_service} "ps -ef | grep ora_smon | grep ${my_base} | sed -e \"s/ */ /g\" | cut -d'?' -f2 | cut -d' ' -f3 | cut -d'_' -f3"` When I use a file listing databases to check them... (1 Reply)
Discussion started by: madmat
1 Replies

3. Solaris

ls command in infinite Loop

Hi, whenever I am giving a 'ls' command system is going into infinite loop displaying the current home directory. There is no separate shell script/file with ls name anywhere in the system. I am using Solaris 10. Any help / guidance in solving this problem is highly appreciated. ... (3 Replies)
Discussion started by: umakant
3 Replies

4. Shell Programming and Scripting

for loop with db2 command

Having some trouble with usage of for loop and displaying words. Basically I had 3 words( some times more ) in the variable. I want to get one at a time to process. I am new to unix scripting so please bear with my question and appreciate your reply. I think this can also me done my awk... (1 Reply)
Discussion started by: Vaddadi
1 Replies

5. Shell Programming and Scripting

running command in while loop

I have a script that users a while read, whithin this I want to execute the cp -i command on some of the results, however because it is in a loop it skips the -i part of cp. How do I get the loop to stop each time cp -i is run and wait for the user to type the response. (2 Replies)
Discussion started by: gefa
2 Replies

6. Shell Programming and Scripting

Need a Command To display "echo command value in loop" in single line.

Hi I want to display "echo command value in loop" in single line. My requirement is to show the input file (test_1.txt) like the output file (test_2.txt) given below. Input file :test_1.txt a1|b1|4|5 a1|b1|42|9 a2|b2|32|25 a1|b1|2|5 a3|b3|4|8 a2|b2|14|6 Output file:test_2.txt... (2 Replies)
Discussion started by: sakthifire
2 Replies

7. UNIX for Dummies Questions & Answers

Awk command in while loop

Hello! I've got a loop in which I am processing a list of values gotten through a file with read command. It seems that instead of processing the lines (values) one by one, I process them all together. the input file is: 20 20 20 80 70 70 20 The code is: (2 Replies)
Discussion started by: haaru
2 Replies

8. Shell Programming and Scripting

Script for telnet and run one command kill it and run another command using while loop

( sleep 3 echo ${LOGIN} sleep 2 echo ${PSWD} sleep 2 while read line do echo "$line" PID=$? sleep 2 kill -9 $PID done < temp sleep 5 echo "exit" ) | telnet ${HOST} while is executing only command and exits. (5 Replies)
Discussion started by: sooda
5 Replies

9. 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

10. UNIX for Beginners Questions & Answers

Mv command in for loop - not working

HI Folks - I'm very frustrated - I'm trying to execute a verys imple for loop and rename the files if they exist. here is my loop : ydate=`TZ=aaa24 date +%m%d` CR_YR=$(date "+%Y") echo $ydate echo ${CR_YR} cd... (6 Replies)
Discussion started by: SIMMS7400
6 Replies
MacroCmd(3U)						    InterViews Reference Manual 					      MacroCmd(3U)

NAME
MacroCmd - a command that composes other commands SYNOPSIS
#include <Unidraw/Commands/macro.h> DESCRIPTION
MacroCmd composes other commands in a linear fashion. Executing a MacroCmd is equivalent to executing its children in preorder. PUBLIC OPERATIONS
MacroCmd(ControlInfo*) MacroCmd( Editor* = nil, Command* first = nil, Command* second = nil, Command* third = nil, Command* fourth = nil ) Construct a MacroCmd instance, optionally supplying up to four of its child commands. virtual void Execute() virtual void Unexecute() virtual boolean Reversible() Execute simply executes each child, from first to last. Unexecute calls Unexecute on each child, from last to first. The MacroCmd is reversible if any of its children are. virtual void SetEditor(Editor*) SetEditor calls SetEditor on each child with the given argument. Command* GetCommand(Iterator) void SetCommand(Command*, Iterator&) GetCommand returns the child Command to which an iterator points. SetCommand initializes the iterator to point to a particular child Command; it initializes the iterator to point to a nil instance if the given Command is not a child. void Append( Command*, Command* = nil, Command* = nil, Command* = nil ) void Prepend( Command*, Command* = nil, Command* = nil, Command* = nil ) void InsertAfter(Iterator, Command*) void InsertBefore(Iterator, Command*) void Remove(Command*) void Remove(Iterator&) Operations that modify the MacroCmd's list of children. Append and Prepend add up to four Commands to the end and the beginning of the list, respectively. InsertAfter and InsertBefore insert a Command after and before the Command pointed to by the iterator, respectively. The Remove operations remove a child from the list without deleting it. You can remove a child by referring to it explicitly or by specifying an iterator. If an iterator is supplied, the Remove operation should advance it to point to the follow- ing child as a side effect. PROTECTED OPERATIONS
Command* Cmd(UList*) UList* Elem(Iterator) Convenience functions for extracting a Command from a UList element a UList from an iterator, respectively. SEE ALSO
Command(3U), Iterator(3U), UList(3U) Unidraw 24 January 1991 MacroCmd(3U)
All times are GMT -4. The time now is 01:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy