Sponsored Content
Full Discussion: First time with loops!
Top Forums Shell Programming and Scripting First time with loops! Post 302476362 by ctsgnb on Wednesday 1st of December 2010 02:05:57 PM
Old 12-01-2010
bt way the trailing
Code:
done
fi

is buggy : it should be
Code:
fi
done

instead
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

While loops

Hi all, I am an amateur k shell scripter and came across something I need clarification on. while ; do various commands done What is the "" condition testing for in the above while loop? THx, Bookoo (5 Replies)
Discussion started by: bookoo
5 Replies

2. Shell Programming and Scripting

loops in loops

ok, i tried to write a script called purge.sh which searches current process' for a specified user running a process with a specified keyword. it also prompts the user to see how many times to purge for the specified process and how many different processes they wish to do this to.it worked until... (11 Replies)
Discussion started by: Blip
11 Replies

3. UNIX for Advanced & Expert Users

Loops

Can anybody help please. I am trying to right a script which will loop until a certain action has been performed. For example i current have two batch jobs i would like to put into a wait status. Batch Jobs A and B . The script i am trying to get to work is below. jobs="A B" COUNT=0 while... (2 Replies)
Discussion started by: mariner
2 Replies

4. Shell Programming and Scripting

Loops within loops

I am running on HPUX using ksh. I have a script that uses a loop within a loop, for some reason the script seems to hang on a particuliar record. The record is fine and hits the condition in Blue. If I kill the 1st loop process the script continues on with no problem. Begin code> <Some... (8 Replies)
Discussion started by: bthomas
8 Replies

5. UNIX for Dummies Questions & Answers

Help with While Loops

I am traversing down a list, and I am not quite sure how to tell the loop to break when it's done going through the file. #!/bin/sh while : do read list <&3 echo $list done is the code. The file "list" is simply 5 4 3 2 1 any advice on how to break the loop after the file is... (1 Reply)
Discussion started by: MaestroRage
1 Replies

6. Shell Programming and Scripting

Help with the 2 for loops

#!/bin/bash IFS=$'\n' A= a c b t g j i e d B= t y u i o p counter=0 found="" for i in $(cat $A) do for j in $(cat $B) do if then found="yes" fi done if then (1 Reply)
Discussion started by: vadharah
1 Replies

7. Shell Programming and Scripting

trying to learn for loops, and arrays at the same time

Ok, I've already completed the task this is for, but now I'm trying to go back and find more eloquent solutions for future reference. I have a report I've generated that is formatted like this: 1033 1 1079 4 1453 5 2205 6 1933 7 461 8 646 9 1655 12 975 13 1289 14 The first number is... (3 Replies)
Discussion started by: DeCoTwc
3 Replies

8. UNIX for Dummies Questions & Answers

For Loops

Hi everyone, I have a question regarding for loops. I am writing a BASH shell script that will contain multiple loops. These loops all involve looping with a count: for (( a=0; a <=10; a++ )); do echo $a done If none of my multiple loops relate to each other throughout the script,... (3 Replies)
Discussion started by: msb65
3 Replies

9. Shell Programming and Scripting

Loops

Hi All, I am very new to Shell scripting. I read basic scripting manual. But i didn't understand the code. Please tell the meaning of the below code: while getopts "F:f:R:r:C:c:" opt 2>/dev/null do case ${opt} in F|f) FREQUENCY_MODE=$OPTARG;; ... (3 Replies)
Discussion started by: pdathu
3 Replies

10. UNIX for Dummies Questions & Answers

Need help with for loops

Why wont my for statements work? Im trying to get this script to swich to a user an if you put in a start/stop/or restart paramater to do just that for each user. I commented out the actual start/stop actions to test it just by using echos and not do anything hasty in the environment but it... (0 Replies)
Discussion started by: LilyClaro
0 Replies
ADSL-STOP(8)						      System Manager's Manual						      ADSL-STOP(8)

NAME
adsl-stop - Shell script to shut down a PPPoE link SYNOPSIS
adsl-stop [config_file] DESCRIPTION
adsl-stop is a shell script which stops the Roaring Penguin user-space PPPoE client. If you omit config_file, the default file /etc/sysconfig/network-scripts/ifcfg-ppp0 is used. AUTHOR
adsl-stop was written by David F. Skoll <dfs@roaringpenguin.com>. The pppoe home page is http://www.roaringpenguin.com/pppoe/. SEE ALSO
pppoe(8), adsl-start(8), adsl-connect(8), pppd(8), pppoe.conf(5), adsl-setup(8), adsl-status(8), pppoe-sniff(8), pppoe-relay(8), pppoe- server(8) 4th Berkeley Distribution 21 February 2000 ADSL-STOP(8)
All times are GMT -4. The time now is 04:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy