I want to replace a line in a file called link.j and run a program after it, when the program is done I want to run it again but with a different replacement for the link.j file as in a loop for all the values specified by me.
So for replacing the one line I have done
sed -i '' -e '3 s/0.5/0.1/' link.j
then run
copy.sh
So I replace the value of the third line from 0.5 to 0.1. Now I want to keep doing it but for values ranging from 0.1 to 1.0 spaced out 0.1 apart, so 0.1,0.2...1.0, and always running the code after.
The code, that I run after, copies the file which I just modified into a new subfolder, so I would like to save these folders before I would run the substitution again.
The copy.sh script looks like this
for dir in `ls -d ../files/files-12/??`
do
id=`echo $dir | awk -F/ '{print $4}'`
mkdir $id
cp ../stack/*/${id}/rf* .
done
copy.shlook like? Maybe there are simplifications possible across the script and the sed command.