Guest User

Untitled

a guest
Apr 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #!/bin/sh
  2. # Embedded archive in shell script.
  3. # To create script:
  4. # cat <this script>.sh <archive file> > <script>.run
  5. # chmod +x <script>.run
  6.  
  7. archive () {
  8. # lines of script to skip (computed automatically)
  9. skip=$(awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' $0)
  10. tail -n +${skip} $0
  11. }
  12.  
  13. ##############################################################################
  14. # Insert your script here. 'archive' will produce the archive on stdout
  15.  
  16. archive | tar ztf -
  17.  
  18. ##############################################################################
  19. # Don't modify anything below this line.
  20. ##############################################################################
  21. exit 0
  22. __ARCHIVE_FOLLOWS__
Add Comment
Please, Sign In to add comment