I have a tar archive xyz.tar containing lots of .sh files like:123.sh456.sh789.shEvery .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; doneI'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.
How to replace string of the file, which is present in tar file through UNIX
bash;sed;tar;gzip;for