Self extracting tarball

I was wondering if anyone can point me to some topics, material, or tutorials that can help me write a shell script that creates a second script that is a Self-extracting tarball. Don't want any actual code obviously because this is a school project, but I feel my teacher didn't well cover the topic(if he did I somehow missed it with perfect attendance) and isn't helping much when i ask questions. Please don't post anything like google or unix . com. Any code I've looked at on the topic seems very confusing so far so i have a lot to do and its going to be a late night. He did mention something about using base64 as a hint.

The base64 hint might be referring to uuencode and uudecode that take 24 bits of three characters and turns them into four characters of 6 bits each plus a constant in the first two bits to make them printable. A script would encode your target file and prepend instructions to run a tail on itself and decode your tailed data. If your file is already compressed in some way, you would need other instructions to appropriately uncompress the output of your tail.

G'luck!

Welcome to the forum.

1 Like

Thank you for the help do you have any links you may suggest or hint commands i can look up in order to base some research off of. Im going to have to read up on a lot of things in order to figure it all out.

For linux use tar with the -z option. Work to compress/uncompress:

tar -cvz tarfilename ./path/to/files   # compress and stroe
tar -xvz tarfilename                        # uncompress and extract to new files