autoextract.sh - make a tar auto-extractable
autoextract.sh is a shell chunck script that makes TAR files auto-extractable.
Prepend the TAR file with autoextract.sh chunk, make it executable and the result is now auto-extractable using any shells.
Create an archive.
$ tar czf data.tar.gz /etc/passwd /etc/group
tar: Removing leading `/' from member names
Create auto-extractable file and make it executable.
$ cat autoextract.sh data.tar.gz >data.sh
$ chmod +x data.sh
Auto-extract data.
$ ./data.sh
$ find .
.
./data.sh
./etc
./etc/passwd
./etc/group
./data.tar.gz
Written by Gaël PORTAY gael.portay@savoirfairelinux.com
Copyright (c) 2016-2017 Gaël PORTAY
This program is free software: you can redistribute it and/or modify it under the terms of the MIT License.