10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am looping through a file in bash and performing some operations on it. Here is the code.
cat test.dat -
One
Two
Three
Case 1: With if inside while loop
Output:
One
file found :)
------------------
isn't it supposed to print following output !!!
one (3 Replies)
Discussion started by: qwarentine
3 Replies
2. Shell Programming and Scripting
I have a script that only works if I remove it from the looping scenario.
#!/bin/bash
# Set the field seperator to a newline
##IFS="
##"
# Loop through the file
##for line in `cat nlist.txt`;do
# put the line into a variable.
##dbuser=$line
echo "copying plugin..."
... (6 Replies)
Discussion started by: bugeye
6 Replies
3. Shell Programming and Scripting
hi all,
i have a for loop statement in my ksh code. it only returns the first value retrieved not the value for the other rows.
ex: acct_id value = returned value in the for loop
1 = 1
2 = 1 (instead of 2)
3 = ... (1 Reply)
Discussion started by: ryukishin_17
1 Replies
4. Shell Programming and Scripting
Hi all,
I need some help. my shell script doesn't work especially in the loop.
#!/bin/sh -xv
export ORA_ADMIN=/oracle/home/admin
export ORACLE_SID=ORA_SID
cat ${ORA_ADMIN}/param_alert_log.ora | while read MSG
do
#echo $MSG
#echo "tail -400... (8 Replies)
Discussion started by: sidobre
8 Replies
5. Shell Programming and Scripting
It just does the break...even though the files are not the same...
# Compare extracts
#==========================================
count=0
while (( count < 5 ))
do
(( count+=1 ))
echo "Try $count"
file1=$(ls -l /tmp/psjava.xml|... (5 Replies)
Discussion started by: sigh2010
5 Replies
6. UNIX for Dummies Questions & Answers
Hey guys...
I'm learning some shell scripting on OS X using the tcsh shell.
For some reason... my while loop isn't executing right (or more likely I am doing something wrong.)
Something as simple as this doesn't work:
#!/bin/tcsh
set g = 0
while ($g <10)
echo "this" $g
@ g =... (2 Replies)
Discussion started by: sprynmr
2 Replies
7. Shell Programming and Scripting
I have a script which uses below for loop:
for (( i = 0 ; i <= 5; i++ ))
do
echo "Welcome $i times"
done
But when I run the script, it gives error message:
Syntex Error : Bad for loop variable
Can anyone guide to run it?
Thanks in advance. (10 Replies)
Discussion started by: naw_deepak
10 Replies
8. Shell Programming and Scripting
I need to converts a CSV file from Format "A" into Format "B", where the first field is repeated in a loop with a counter. I'am quite sure that this is with AWK possible burt the "Forum Search Function" doesn't work at the moment.
Format "A"
A1;B1
;B2
;B3
A2;C1
;C2
;C3
... (2 Replies)
Discussion started by: frieling
2 Replies
9. UNIX for Dummies Questions & Answers
I have a serious problem and Im sure im just doing something stupid
######Start Load
while
do
/export/home/mldwh/rkem_refresh/int_load/scripts/rkem_refresh.sh
sleep 10
while
do
sleep 5
done
done
######Log and Runstats
sleep... (12 Replies)
Discussion started by: jadionne
12 Replies
10. UNIX for Dummies Questions & Answers
I have written a script to run on UNIX server. When I tested, it always hanged on after "date +"%D %T: XXXXXX script started." part. Then it wouldn't go further. UNIX server gave me one error message. I used the same code in another script. It works fine. I think the major problem may be in... (3 Replies)
Discussion started by: duke0001
3 Replies