I have a .sh build file which is basically a tar.gz file wrapped up with few lines of shell code. I know how to pack a tar.gz into shell like this, but how to do the reverse i.e., unpack the tgz file present in the .sh file?
Thank you in advance!
I have a .sh build file which is basically a tar.gz file wrapped up with few lines of shell code. I know how to pack a tar.gz into shell like this, but how to do the reverse i.e., unpack the tgz file present in the .sh file?
Thank you in advance!
I got the solution, if in case anyone needs it!
Get the number of lines of shell code in the .sh file, say n lines. Now delete first n=21 lines of .sh file and save the rest in the other file say sample.tar like:
sed '1,21d' sc_300026_smca.sh > sample.tar
Now we'll end up with sample.tar, the required file.