Hi evryone
i need a help .
i have a file xcv.the content is :
accelerate
i want a script which will run 1000 times in loop and changing the value to
accelerate to
acceler
in 1st loop and in 2nd loop it will be again
accelerate and so on .
Hi evryone
i need a help .
i have a file xcv.the content is :
accelerate
i want a script which will run 1000 times in loop and changing the value to
accelerate to
acceler
in 1st loop and in 2nd loop it will be again
accelerate and so on .
Requirement not clear. 1000 times to change accelerate to acceler?
regards,
Ahamed
yes ....1000 times to change accelerate to acceler?
You can try using sed option...inside for loop
sed 's/accelerate/acceler/g' inputfile
Thanks
SHa
sed 's/accelerate/acceler/g' inputfile
by this i can get value "acceler" in 1st loop but in 2nd loop i wantreverse
The example you're giving for this question is so absurd I have to ask: is this homework?
So you need to check the current state and act differently depending on the current state
if accelerate=$(grep accelerate inputfile); then
sed 's/accelerate/acceler/g' inputfile
else
sed 's/acceler/accelerate/g' inputfile
fi