10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi All,
I'm trying to write while loop with multiple if conditions. Each and every if condition with different variables. whenever one if condition fails i have remove the file
from filename and have to pick another file and loop should exit until the last file found in filename. Please help... (2 Replies)
Discussion started by: Kayal
2 Replies
2. Shell Programming and Scripting
in my python script i have loop like below:
for item in itemlist:
if <condition>:
<code>
else:
<code>
if <condition>:
if <condition>:
<code>
else:
for type in types:
if... (1 Reply)
Discussion started by: ctrld
1 Replies
3. 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.
#!/bin/bash
for i in 1 2 3 4 5 6
do
echo "$i"
if
echo "Oh Nooo... i = $i. I need to stop the iteration and jump out of the loop"
then break
fi
done
But, it only... (3 Replies)
Discussion started by: John K
3 Replies
4. Shell Programming and Scripting
Hi I'm comparing same files names which are in different folders .
The first for loop for the files in DAY1 folder and
the second for loop for the files in DAY2 folder .
the first IF condition is for checking whether the file names are equal
the second If condtion is for checking the... (4 Replies)
Discussion started by: smile689
4 Replies
5. Shell Programming and Scripting
notimes=5
word=excellency
the word excellency contains 10 letters. 10 letters divided by 2 = 5. which means, 5 two-groups of letters are in the word excellency.
i need to perform a function on each group of letters. but the only thing i can think of is the following, which i just know... (5 Replies)
Discussion started by: SkySmart
5 Replies
6. Shell Programming and Scripting
Hi gurus, I have the following part of code which I am using for treating input
#!/bin/bash
while ]; do
arg=$1; shift
case $arg in
-u)
users="$1"
shift
;;
-g)
groups="$1"
shift
;;
... (4 Replies)
Discussion started by: wakatana
4 Replies
7. Shell Programming and Scripting
I am having trouble figuring this code
I want to grep a text from a file and if it match certain text it break out of the loop or it should continue searching for the text
Here is what I have written but it isn't working
while true
f=`grep 'END OF STATUS REPORT' filename`
do
if ... (9 Replies)
Discussion started by: Issemael
9 Replies
8. Shell Programming and Scripting
Hi all, im doing this script in which i read from a logfile line by line, my problem is this:
The script was working fine until i added this statement to SSH into another machine to look for some data, it enters and retrieves the data just fine, but for some strange reason after it goes thru the... (1 Reply)
Discussion started by: sx3v1l_1n51de
1 Replies
9. Shell Programming and Scripting
Hi All,
Please help me out in this... I am new to scripting
How to compare two strings by using the same string in single loop,
I am using ksh
for ex:see the code snippet below
I am writing in java,
Can u guys tell me that in scripting
if ("string1"=="string2" ||... (2 Replies)
Discussion started by: Anji
2 Replies
10. Shell Programming and Scripting
Hi Folks,
I am trying to write a simple script which involves a potentially infinite loop repeating a number of tasks quickly.
I would like to enable the user to break out of this when he/she wishes (some key stroke) but not to break out of the script (i.e. which is what happens when a user... (4 Replies)
Discussion started by: beckett
4 Replies