(I think this question desearves separate thread..)
I have a problem with 'while'
I am trying to set variables by 'while' and it is fine inside, but after completting the loop all changes are lost:
> bb="kkkk - 111\nlllll - 22222\nbbbb - 4444"
> echo "$bb"
kkkk - 111
lllll - 22222
bbbb -... (3 Replies)
Hi, I have a file with the following data
-0.00000 0.00000 0.00000 F F F
0.00000 0.00000 0.80000 F F F
0.50000 0.50000 0.60000 F F F
0.50000 0.50000 0.20000 F F F
-0.00000 0.00000 0.40000 F F F
I would like to change the last 3 lines from F F F to T T T. I tried looping each line but don't... (5 Replies)
Hello friends,
i wrote a script which includes a couple of if-else loops but i have to change it to while-do loop as it is not allowed to use "break" in if-else loop in bash.
#!/bin/bash -x
NUM=`find . -name ufsdump_output1.txt | xargs egrep "End-of-tape detected"`
if ; then echo "OK!"... (6 Replies)
I need to do something like this:for I in var1 var2 var3 ; do
$I = "Something calculated inside the loop"
doneObviously it doesn't work...but is it possible doing that in other ways?
Thanks in advance. (6 Replies)
i am new to shell scripting. this is similar to the code which i was writing for some other work. i want the variable 'x' to have the value which it will finally have at the end of the loop ( the number of directories ). but the value of 'x' only changes inside the loop and it remains '0' out-side... (3 Replies)
Hi everyone,
I am fairly new to shell scripting. I want to read in numbers from a file (one number per line). This works perfectly fine
while read CurrentLine
do
echo $CurrentLine
done < myfile
and yields the correct output:
272
745
123
If I however run a ffmpeg... (2 Replies)
Hi guys, i have an executable file that contains several records and fields. One of the records has a variable filed that must be changed each time i want to execute the file. Would it be possible that i can use a loop to change the value of that field? Suppose that the field address is:
Record... (5 Replies)
Dear All,
I have many sub-folders but each of them have a file with same name but different data.
I want to either move or copy them into a new folder but they need to have the path of where they are coming as part of their name...
I have managed to find the files but dont know how to change... (2 Replies)
In a "for i in *FD.CPY do" loop, I need to change .CPY to .layout so the executed command would be
reclay blahFD.CPY >blahFD.layout
What do I need to do to modify a copy of i to use after the > symbol?
TIA (5 Replies)