I have a tar archive xyz.tar containing lots of .sh files like:
123.sh 456.sh 789.sh
.sh file has some string content, e.g.
123.sh contains welcome to Hollywood,
456.sh contains I love Hollywood, and
789.sh contains Hollywood movies.
Now, my objective is to replace the string Hollywood by Oscar in all the
.sh files using a loop.
I tried this command:
for i in $(tar -xvf xyz.tar); do sed -e 's/Hollywood/Oscar/' $i; done
I'm getting output on command window, but o/p is not reflecting in xyz.tar archive because unable to recompress the tar archive, after extraction and replacement command.