[aklug] Re: Self-extracting Archive

From: barsalou <barjunk@attglobal.net>
Date: Fri May 08 2009 - 16:12:57 AKDT

Quoting Christopher Howard <choward@indicium.us>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm trying to create a self-extracting archive/installer by following
> some online-instructions, but it doesn't seem to be working. Can anyone
> tell me what is wrong with this script?
>
> #!/bin/bash
>
> echo ""
> echo "Self Extracting Installer"
> echo ""
>
> export TMPDIR=3D`mktemp -d /tmp/selfextract.1029349304`
>
> ARCHIVE=3D`awk '/^__ARCHIVE_BELOW__/ {print NR + 1; exit 0; }' $0`
>
> tail -n+$ARCHIVE $0 | tar xzv -C $TMPDIR
>
> CDIR=3D`pwd`
> cd $TMPDIR
> ./installer.sh
>
> cd $CDIR
> rm -rf $TMPDIR
>
> exit 0
>
> __ARCHIVE_BELOW__
>
> I cat a tar.gz archive onto the end of this script, and then execute it
> to see if it works. When I run it, it outputs the echo message, but then
> ramps my cpu load up to 100% and hangs there until I kill it. When I
> kill it, I get this output:
>
> tar: option requires an argument -- C
> Try `tar --help' or `tar --usage' for more information.
> ./test.bsx: line 14: ./installer.sh: No such file or directory
>
> I have an overarching perspective of what the script is doing, but my
> awk, bash, and tar skills are not very far developed, so I'm not sure
> what is going wrong.
>

Chris,

Verify that $TMPDIR has a value in it.

Mike B.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Fri May 8 16:13:06 2009

This archive was generated by hypermail 2.1.8 : Fri May 08 2009 - 16:13:06 AKDT