10-22-2017
Excellent, "break" worked a treat! Many thanks.
Any suggestions as to where to find some decent tutorials on using "while" loops? I don't just want to throw a messy script together and call it quits, I actually want to learn how to do this properly?
Appreciate the quick reply though.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a folder with lots of file. e.g. a.txt, b.txt, c.txt.... I want to put these files from the source directory and place them in a destination directory in a specific order, such as /destination/a/a.txt, /destination/b/b.txt, /destination/c/c.txt, ......
Please help. Thx :confused: (3 Replies)
Discussion started by: aaron_fong
3 Replies
2. Shell Programming and Scripting
Hey all I'm working on a script that will scour a directory of 6000+ files for a line that at the end has a number.
Something like 'The number of outputs is: 39200'
I'm trying to devise a script to add all of these numbers up, so far I have the grep statement that pulls out each individual... (7 Replies)
Discussion started by: TiznaraN
7 Replies
3. Shell Programming and Scripting
. ./testFile.sh
url=http://ichart.finance.yahoo.com/table.csv?s= suf=&d=5&e=9&f=2009&g=d&a=1&b=4&c=1999&ignore=.csv
wget $url$s1$suf;
sleep 10;
cat header.txt > $s1.txt;
chmod 777 $s1.txt;
sed '1d' table.csv?s\=$s1 >> $s1.txt;
rm -Rf table*
Very new at shell scripting as you can see... (3 Replies)
Discussion started by: harte
3 Replies
4. UNIX for Dummies Questions & Answers
Hello there
Been using Unix bash scripting for two days now so am very new to this. I am currently doing a project now and i'm basically making a noughts and crosses game (or tic tac toe).
I have created the board using an array. When I try and check to see if the array is empty using an If... (3 Replies)
Discussion started by: ChrisHoogie
3 Replies
5. Shell Programming and Scripting
Hello,
I'm new to Sheel script and I need your help for a script I need to develop (for me).
Indead, I have a software which log all entry from internet and save it in text file.
But, the log is practically unreadable because every 256 characters jump to a new line (even if the message is... (5 Replies)
Discussion started by: acidoangel
5 Replies
6. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
Arguments:
http://farm9.staticflickr.com/8070/8212131370_8b6e8c10c5_c.jpg
I am given these three arguments. $1, $2, $3
The first argument is the path to a directory.
So, how would I go into the directory and compare files?
I... (5 Replies)
Discussion started by: spider-man
5 Replies
7. Shell Programming and Scripting
Hi All,
I have a script that I wrote on a bash shell, I use it to sort files from a directory into various other directories. I have an variable set, which is an array of strings, I then check each file against the array and if it is in there the script sorts it into the correct folder.
But... (5 Replies)
Discussion started by: sgtbobie
5 Replies
8. Shell Programming and Scripting
Hi All,
I am trying to monitor CPU load of few processes, with the same name.
The output that I get from top is the following
28171 root 20 0 1089m 21m 3608 S 103 0.3 15:16.89 /opt/ppp//h264rtptranscoder.bin --videoPort=14504 --audioPort=14505
27589 root 20 0 1060m 23m... (3 Replies)
Discussion started by: liviusbr
3 Replies
9. Shell Programming and Scripting
Hi everyone,
i have the following script.sh:
foo='lsusb | grep Webcam | cut -c16-18'
sudo /home/user/public/usbreset /dev/bus/usb/001/$foo
when i try to call this script from python using subprocess.call("script.sh", shell=True) it seems that only 'sudo /home/user/public/usbreset' is being... (6 Replies)
Discussion started by: hilfemir
6 Replies
10. Shell Programming and Scripting
Hi all
I have the folloing process that needs checking often:
ps -ef | grep ih
bscsrtx 206 15901 0 11:28:10 pts/6 0:00 fih -r4
bscsrtx 218 15901 0 11:28:27 pts/6 0:01 aih
bscsrtx 29763 15901 4 11:27:16 pts/6 0:59 rdh -prih
root 429 27268 0 11:30:15 pts/td ... (13 Replies)
Discussion started by: fretagi
13 Replies