Paste number 9611: bash weirdness

Paste number 9611: bash weirdness
Pasted by: RangerRick
When:5 years, 3 weeks ago
Share:Tweet this! | http://paste.lisp.org/+7EZ
Channel:#fink
Paste contents:
Raw Source | XML | Display As
#!/bin/bash

trap "" INT

LOGDIR="/tmp/buildlog"
mkdir -p "$LOGDIR"

TYPE="$1";     shift
NAME="$1";     shift
VERSION="$1";  shift
REVISION="$1"; shift

rm -rf "$LOGDIR/$NAME-$VERSION-$REVISION.failed"

date > "$LOGDIR/$NAME-$VERSION-$REVISION.$TYPE"
(trap "touch \"$LOGDIR/$NAME-$VERSION-$REVISION.failed\"" SIGINT; "$@") 2>&1 | tee -a "$LOGDIR/$NAME-$VERSION-$REVISION.$TYPE"

if [ -f "$LOGDIR/$NAME-$VERSION-$REVISION.failed" ]; then
        echo "$NAME-$VERSION-$REVISION $TYPE-build failed!"
        rm -rf "$LOGDIR/$NAME-$VERSION-$REVISION.failed"
        exit 1
fi

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.