10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
I am comparing the number of records in the .bad record from sql loader, if it is higher than the number passed in as an argument, the program should exit. However, I constantly receive the error " 0403-016 Cannot find or open the file." on the line with the if statement "elif ;". The code... (3 Replies)
Discussion started by: MIA651
3 Replies
2. Shell Programming and Scripting
Hello ALL,
need a BASH script who find file and send email with attachment.
I have 50 folders without sub directories in each generated files of different sizes but with a similar name Rp01.txt Rp02.txt Rp03.txt ...etc. Each directors bound by mail group, I need a script that goes as... (1 Reply)
Discussion started by: penchev
1 Replies
3. Shell Programming and Scripting
Hi,
I'm a rookie who is trying to learn this stuff. What I need help with is putting together a non complicated "while" loop within the below "if" statement. I also need the while loop to keep looping until the user types a key to end the loop. Please reveal the proper insertion points. Thank... (4 Replies)
Discussion started by: jefferj54
4 Replies
4. Shell Programming and Scripting
I need to match multiple values in a single column in a file:
example:
Source file:
abd,123,one
def,232,two
ghi,987,six
Target file:
12345,abcde,123
09876,zxvyr,566
56789,lmnop,232
Variable:
var1=`grep 2 sourcefile | awk '{print$1}'
essentially, echo "$var1" would read:... (2 Replies)
Discussion started by: kopfgeldjagar
2 Replies
5. UNIX for Dummies Questions & Answers
I need to check if an entry input by the user is in a file. If so, I need to run a command, and if it does not exist then it should output entry does not exist.
So I have so far...
echo "Enter record:"
read record
//command || //command
Can I use an if statement to do this? (3 Replies)
Discussion started by: itech4814
3 Replies
6. Shell Programming and Scripting
Hey guys,
a=`cat abc | wc -l`
b=`cat def | wc -l`
if $a== $b
then
echo "a"
else
echo "b"
fi
I want the if condition to retry itself , untill a==b.
I can't use goto statemt.
Please help.
Thanx in advance.
Please use next time code tags for your code and data (5 Replies)
Discussion started by: jaituteja
5 Replies
7. UNIX for Dummies Questions & Answers
Hello All,
This question is actually for the service console of VMware ESX 3.5 but is relevant to this forum I think. I have been advised to use the following commands:
for i in `find /vmfs/volumes/Test_VMFS/ -name "*.vmx"`
do
echo "$i"
#sed -i 's/scsi1:0.present =... (3 Replies)
Discussion started by: mronsman
3 Replies
8. Shell Programming and Scripting
I'm having a question about for loops. (bash)
I have the following for example:
for file in `ls *.txt`
do
read file ...
done
Now when there is a file present there is no problem, now when there is no file present I get the following output in my standard mail box : "No such... (4 Replies)
Discussion started by: lumdev
4 Replies
9. UNIX for Dummies Questions & Answers
#!/usr/bin/ksh
echo Please enter
while read n
do
echo $n >> datafile
done
question:
How can I enject an if statement that if the users enter 0 (zero) the program will exit?
this is what I have but not working
#!/usr/bin/ksh
echo Please enter number
while read n
do
if $n=0
then... (2 Replies)
Discussion started by: bobo
2 Replies
10. UNIX for Dummies Questions & Answers
I am attempting to pass a string into awk and loop through it, and then for every occurrance of a certain character perform an action. In this case, for example, echo 1 for each time character r is found in the string. Except I can't get it to work. Could someone please tell me why?
echo... (7 Replies)
Discussion started by: Sniper Pixie
7 Replies