Sponsored Content
Top Forums Shell Programming and Scripting 2 CMD results on the same line while rexing in a loop Post 302360555 by linux_lou on Friday 9th of October 2009 04:20:23 PM
Old 10-09-2009
Thank you Folks!

---------- Post updated at 04:20 PM ---------- Previous update was at 09:36 AM ----------

while read i
do
: whatever
done < list

When I tried this example, the program ran the first line as expected and did not advance to the second. Tried it with the ":" and without, same results.

while read i
do
: ans=`rexsh $i -l bozo -t10 uptime | cut -d" " -f6`
echo "$i|$ans" >>bootTimes.out

if [ $ans -ge 120 ]
then
echo "$i|$ans" >>bootThese.out
else
echo "$i|$ans" >>bootList2Recent2Work.out
fi

done < list
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl - Iterating a hash through a foreach loop - unexpected results

i've reworked some code from an earlier post, and it isn't working as expected i've simplified it to try and find the problem. i spent hours trying to figure out what is wrong, eventually thinking there was a bug in perl or a problem with my computer. but, i've tried it on 3 machines with the... (5 Replies)
Discussion started by: quantumechanix
5 Replies

2. Shell Programming and Scripting

works from cmd-line but not in script

hi I'm trying to query a directory, check it's the right directory, return the results into a text file, put text file into an array and navigate the subdirectories and delete contents. find `pwd` -type d | grep TESTINGDIR > dirList.txt The txt file is created from the cmd-line but not in... (4 Replies)
Discussion started by: OFFSIHR
4 Replies

3. Shell Programming and Scripting

Removing tokens from cmd line

Hi everyone. I am trying to develop my own shell,and i am in the part of redirection. let's say the user gives as input cat test > test2 in the array of arguments i want to keep only arg=cat,arg=test. ">" token is not an input file so cat cannot worka and test2 is output.how can i remove > and... (1 Reply)
Discussion started by: bashuser2
1 Replies

4. Solaris

Reset ILOM from cmd line

One of our T5220 console is not working & unable to login to ILOM , but system is up & running . is there a way to reset ILOM from command line ? (8 Replies)
Discussion started by: skamal4u
8 Replies

5. Shell Programming and Scripting

doing a for loop adding up the results

Hi there If I run a 'swap -l' on my solaris box, i get swapfile dev swaplo blocks free /dev/dsk/c1t0d0s1 54,65 8 67119560 65655144 /dev/dsk/c1t0d0s2 54,65 8 33119522 32655122 I wanted to run a for loop adding up the totals of each column 4 , excluding the... (2 Replies)
Discussion started by: hcclnoodles
2 Replies

6. Programming

How to take input from cmd line into file

Hi, I want to be able to write a simple program that takes in input from the command line. I;m am at the level of getchar and putchar. Any examples would be a great help thanks. I intend/prefer also to use the pipe command | eg: input | file1 ---------- Post updated at 04:08 PM ----------... (4 Replies)
Discussion started by: metros
4 Replies

7. Shell Programming and Scripting

Concatenate Loop Results

Hi, I have the following situation: Param1Values = AAAA,BBBB Param1=$(echo $Param1Values| tr "," "\n") for x in $Param1 do db2 select X from Y where Z IN ('$x') done Obviously the above will perform the select 'x' amount of times. Is there a way in which i can... (13 Replies)
Discussion started by: RichZR
13 Replies

8. Shell Programming and Scripting

Loop through awk results

I have files structured in stanzas, whose title is '', and the rest couples of 'id: value'. I need to find text within the title and return the whole stanzas that match the title. The following works: awk 'BEGIN{RS="";IGNORECASE=1}/^\/' myfileI would need to count all of the occurences, though,... (7 Replies)
Discussion started by: hermes14
7 Replies

9. Shell Programming and Scripting

Narrowing sed Results in While Loop

find $SRC -type f -name *.emlx | while read FILE do if : then sed -n '/From/p' $FILE fi done > $DEST-output.txt The loop above spits out a .txt file with several lines that look like this: From: John Smith <jsmith@company.com> How can I narrow that sed result to spit out the email... (5 Replies)
Discussion started by: sudo
5 Replies

10. Shell Programming and Scripting

Df -h results in a loop

Hello everyone, I am doing a check of the disk space using df -h, I want to combine the result in break line; but the result after while/done is empty: # df -h Filesystem Size Used Avail Use% Mounted on rootfs 20G 14G 4.6G 75% / /dev/root 20G 14G 4.6G 75% /... (15 Replies)
Discussion started by: Abu Rayane
15 Replies
MODEMTEST(1p)						User Contributed Perl Documentation					     MODEMTEST(1p)

NAME
modemtest - Tool to examining your modem through Perl's Device::SerialPort SYNOPSIS
modemtest [OPTS] [DEVICE [BAUD [DATA [PARITY [STOP [FLOW]]]]]] DEVICE Device to use as a serial port (default: "/dev/modem") BAUD Serial speed to use (default: 9600) DATA Number of databits to use (default: 8) PARITY Type of parity to use (default: "none") STOP Number of stop bits to use (default: 1) FLOW Kind of flow control to use (default: "none") -h, --help Help report --skip-status Skip modem status bit tests --hide-possible Don't show all possible settings DESCRIPTION
Some systems, serial ports, and modem behave in strange ways. To test the capabilities of Perl's Device::SerialPort, this tool queries the system settings for the given DEVICE, and attempts to set up the port and send the initialization string "ATE1" to the modem, reporting the results seen. SEE ALSO
Device::SerialPort(3) perl(1) AUTHOR
Kees Cook <kees@outflux.net>. COPYRIGHT AND LICENSE
Copyright 2000-2004 by Kees Cook <kees@outflux.net>. This program is free software; you may redistribute it and/or modify it under the same terms ans Perl itself. perl v5.14.2 2006-10-28 MODEMTEST(1p)
All times are GMT -4. The time now is 08:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy