10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
2. Shell Programming and Scripting
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
3. UNIX for Dummies Questions & Answers
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
4. Shell Programming and Scripting
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
5. Shell Programming and Scripting
#!/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
6. UNIX for Dummies Questions & Answers
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
7. Shell Programming and Scripting
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
8. UNIX for Advanced & Expert Users
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
9. Shell Programming and Scripting
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
10. UNIX for Dummies Questions & Answers
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