This code below is from a raspberry pi install script. At the bottom of the script is a block on nonsensical data which the awk command is processing to create the file release.tgz

It is passing a hidden command or script of some kind to the system which takes some time to run before execution continues. The delay seems to be the tail command?

I run tar on the file release.tgz it comes up with a lone error block and exits.


export LC_ALL=C

#extract archive
ARCHIVE=`awk '/^__ARCHIVE_BELOW__/ {print NR + 1; exit 0; }' $0`  
tail -n+$ARCHIVE $0 > ./release.tgz  
tar xzf ./release.tgz -C / 2> /dev/null  
rm ./release.tgz
  • ^Essentially the same thing, but with intermediate files instead of a pipeline. – muru May 26 at 11:01

Browse other questions tagged or ask your own question.