![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| while loop not taking the not equal to condition | ssuresh1999 | UNIX for Dummies Questions & Answers | 9 | 08-12-2008 10:05 AM |
| put an interactive script in background after taking input | epsilonaurigae | Shell Programming and Scripting | 7 | 02-15-2008 10:18 PM |
| need help with using input file in the while loop | sytycd712 | Shell Programming and Scripting | 2 | 08-16-2007 12:11 AM |
| Problem with ^M in input file | noelcantona | Shell Programming and Scripting | 2 | 10-24-2005 05:58 AM |
| TCSH.need help.take input during a while/end loop | seg | Shell Programming and Scripting | 1 | 08-28-2003 04:41 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Problem taking input from file with for loop
I am trying to take input from a file and direct it into a bash script. This script is meant to be a foreach loop. I would like the script to process each item in the list one by one and direct the output to a file.
[root@uverse ~]# cat 1loop #!/bin/bash # this 2>&1 to redirect STDERR & STDOUT to file LIST=$1 for i in "$LIST"; do ping -c 2 "$LIST"; &> /root/error_mess done I have a file called ipaddresses with one ip per line. This script works if I supply one ip after the script name upon execution, but not like this #./1loop < ipaddresses |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|