10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Based on text file:
PATH:/media/hdd/Media/Video/title1 FILE:/media/cache/281662-14.jpg
PATH:/media/hdd/Media/Video/title2 FILE:/media/cache/281662-15.jpg
PATH:/media/hdd/Media/Video/title3 FILE:/media/cache/281662-16.jpg
PATH:/media/hdd/Media/Video/title4 FILE:/media/cache/281662-17.jpg... (12 Replies)
Discussion started by: TiedCone
12 Replies
2. Shell Programming and Scripting
Hi,
I am trying to read a file line by line inside of a while loop. This while loop is part of a here document.
while read line
do
ssh -t $2@$remotehost <<REMOTE
ls path/to/dir > $path_to_dir
while read line1
do
echo "LINE --- $line"
done... (4 Replies)
Discussion started by: mnanavati
4 Replies
3. Shell Programming and Scripting
Hi
I am using while loop, below, to read lines from a very large file, around 400,000 rows. The script works fine until around line 300k but then starts giving incorrect result.
I have tried running the script with a smaller data set and it works fine. I made sure to include the line where... (2 Replies)
Discussion started by: saurabhkumar198
2 Replies
4. Shell Programming and Scripting
apologies for the basicness of this question, but within a for loop how can i "list" my values as opposed to adding them to the same line
for example if i use this it works fine
for n in peter paul david
do
echo "my name is $n"
done
but i wanted to list my items ( i have quite a... (2 Replies)
Discussion started by: rethink
2 Replies
5. Shell Programming and Scripting
Hi I'm writing a bash script which will read an input file and look for occurrences of the current user ($USER) executing the script. When i find the occurrence of the username I take that line and append it to a file with a line number and bracket display next to line.
The input file has been... (12 Replies)
Discussion started by: BundBash
12 Replies
6. Shell Programming and Scripting
Hi All,
How can we use read line using the index value of a FOR loop?
eg:
pt_mstr,pt_status,8
pt_mstr,pt_buyer,8
pt_mstr,pt_sfty_stk,8
pt_mstr,pt_ord_pol,3
pt_mstr,pt_capacity,8
pt_mstr,pt_plan_ord,3
pt_mstr,pt_ord_mult,8
From this file i want to read the line2, 3 and 4 only using a FOR... (3 Replies)
Discussion started by: balajim
3 Replies
7. Shell Programming and Scripting
Hello
I am a beginner of shell scripting and i am having trouble to do a for loop.
I want a for loop to do stuff 3 times.
i.e.
in visual basic i do this
for (counter = 0; counter < 3; counter++)
on my shell script i have something like this at the moment
... (7 Replies)
Discussion started by: arex876
7 Replies
8. Shell Programming and Scripting
Hello all,
I am trying to write a simple script that will parse through a text/properties file and check a couple of if statements.
Here is what I have so far:
FILENAME=$1
while read line
do
echo $line
done < $FILENAME
When I call ./simple.sh testfile.txt I recieve a file or... (7 Replies)
Discussion started by: lamagra
7 Replies
9. Shell Programming and Scripting
I have written a script that countsdown from 20 to 1 and has a sleep in between each count but I want to make it sleep for half a second but I get errors whenever I change the sleep from 1 second to half a second any ideas? I am using Sun OS 5.9 heres what I've got:
X=0
while
do
echo... (3 Replies)
Discussion started by: Brokeback
3 Replies
10. Shell Programming and Scripting
Hey all. Thanks in advance for any help you can give, hopefully this is an easy one. I want to create a loop to run a simple performance monitor like vmstat and record it to a file, but have very limited scripting skills (obviously).
Starting with this...
date >> /var/log/perfmon.log
vmstat... (2 Replies)
Discussion started by: mattlock73
2 Replies