10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Oracle Linux : 6.4/bash shell
In the below I want to break out of the loop when it enters the 5th iteration.
for i in 1 2 3 4 5 6
echo "Oh Nooo... i = $i. I need to stop the iteration and jump out of the loop"
But, it only... (3 Replies)
Discussion started by: John K
2. Shell Programming and Scripting
I'm obviously very new to this. I'm trying to write a simple for loop that will read the directory names in /Users and then copy a file into the same subdir in each user directory.
I have this, and it works but it isn't great.
for dirs in $HOMEDIRS; do
if ];... (5 Replies)
Discussion started by: Heath_T
3. Shell Programming and Scripting
OS : RHEL 6.1
Shell : Bash
I had a similair post on this a few weeks back. But I didn't explain my requirements clearly then. Hence starting a new thread now.
I have lots of files in /tmp/stage directory as show below.
I want to loop through each files to run a command on each file.
I... (8 Replies)
Discussion started by: kraljic
4. Shell Programming and Scripting
following code snippet should output nothing, IMHO. But the result is "THE END".
if true ; thenexit
fi | grep "somesearchstring"
echo "THE END"using bash 4.1.9(1)
Bug or feature?
Hagen (5 Replies)
Discussion started by: montour
5. Emergency UNIX and Linux Support
Below for loop not exiting. Can someone help?
if ; then
for i in $JBOSS_INST_ARGS; do
done (8 Replies)
Discussion started by: vino_hymi
6. Shell Programming and Scripting
how to exit from "if" loop?actually i have mutliple "if" conditions, i have to exit from each "if" loop,if it is true...:confused:
Please suggest me... (3 Replies)
Discussion started by: sreelu
7. Shell Programming and Scripting
Hi Im running this script, which is supposed to find the max value build some tables and then stop running once all the tables are built. Thing is , it keeps assigning a null value to $h and then $g is null so it keep building tables i.e. testupdateNUL. How can I stop this? Here is what I have:
... (4 Replies)
Discussion started by: brandono66
8. Shell Programming and Scripting
sorry for being dumb here, but is there a way my for loop can take an entire line of a file into consideration instead of each word in a line... ill explain
if i have a file like this
# cat list
and a script that does this
# cat list.sh
... (6 Replies)
Discussion started by: hcclnoodles
9. UNIX for Dummies Questions & Answers
have a basic query.
Please see the below code:
list="one two three"
for var in $list ; do
Wht if I want to print only first/ last line in the list
Eg one & three
er_ashu (3 Replies)
Discussion started by: er_ashu
10. Shell Programming and Scripting
i wrote a while script as part of a huge program. this script, once picked, begins to output data to the person using it. pretty easy, as the person doesn't have to keep typing commands to get the output that the while loop automatically throws out.
now, the thing is, while this while-script... (3 Replies)
Discussion started by: Terrible