auto
 ¾    #!/bin/bash
# this script was downloaded from:
# https://jeroen.a-eskwadraat.nl/sw/annotate
# and is part of devscripts 2.23.4+deb12u2

# Executes a program annotating the output linewise with time and stream
# Version 1.2

# Copyright 2003, 2004 Jeroen van Wolffelaar <jeroen@wolffelaar.nl>

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

PROGNAME=${0##*/}

addtime() {
	while IFS= read -r line; do
		printf "%s %s: %s\n" "$(date "${FMT}")" "$1" "$line"
	done
	if [ ! -z "$line" ]; then
		printf "%s %s: %s" "$(date "${FMT}")" "$1" "$line"
	fi
}

addprefix() {
	while IFS= read -r line; do
		printf "%s: %s\n" "$1" "$line"
	done
	if [ ! -z "$line" ]; then
		printf "%s: %s" "$1" "$line"
	fi
}

usage() {
	echo \
"Usage: $PROGNAME [options] program [args ...]
  Run program and annotate STDOUT/STDERR with a timestamp.

  Options:
   +FORMAT    - Controls the timestamp format as per date(1)
   -h, --help - Show this message"
}

FMT="+%H:%M:%S"
while [ "$1" ]; do
	case "$1" in
	+*)
		FMT="$1"
		shift
		;;
	-h|-help|--help)
		usage
		exit 0
		;;
	*)
		break
		;;
	esac
done

if [ $# -lt 1 ]; then
	usage
	exit 1
fi

cleanup() { __st=$?; rm -rf "$tmp"; exit $__st; }
trap cleanup 0
trap 'exit $?' 1 2 13 15

tmp=$(mktemp -d --tmpdir annotate.XXXXXX) || exit 1
OUT=$tmp/out
ERR=$tmp/err

mkfifo $OUT $ERR || exit 1

if [ "${FMT/\%}" != "${FMT}" ] ; then
	addtime O < $OUT &
	addtime E < $ERR &
else
	# If FMT does not contain a %, use the optimized version that
	# does not call 'date'.
	addprefix "${FMT#+} O" < $OUT &
	addprefix "${FMT#+} E" < $ERR &
fi

echo "Started $@" | addtime I
"$@" > $OUT 2> $ERR ; EXIT=$?
rm -f $OUT $ERR
wait

echo "Finished with exitcode $EXIT" | addtime I

exit $EXIT
     ˆÇÆÉ607ÅÁÌ _    ‹      ½–]oÚ0…ïû+<_ìŽ¼I £¥!SG�†Æ— S7M»0±I¬†8²ÍhûëçFÓŠtí@»òGNŽßÇÇŠã½&½ðû´�>‡£!š~ý4ôn Ü4{ A”Z–í ôÇáDë¼°Ùl¬MÓ2†p‰^¥-PZòH[TSìŸyÅœ†¼„jZäi®Sæ2Êî�X"k­8e-X+	*!’ÑÖËÍ•¥Þ8ÀÎÂ[z_8;op1âíâd±5+ºÒ÷t‚~‘”ÇYk‘cßã«)u1ðHd
)Én­˜/1"©îâƒÞä§Ñ�NŠ·}� D²eìuÇW“î5öÇdÅ< ‡5£R3$J£• |É­ÏKñœ?Ô¥&`*’<×\d�R0ˆUÔH¤*'†õÜ$²ª*%ôo»A¢'›1½žõÇa0˜•[B‹Çêê2ÁþÔt3�.Y¤…¼ß•\¾ÿ>[¨üêÏí
’<N4öj ƒÊ7Phv§«á·ð`ý»³c-ö«£j½Ï
tmÇnØç»�œfÇuª#ù`9–d)RÊd•¥.vGVyÊ”Ùü}÷E
·Ù°/îrÎ;v³žây¬³ÛLl²*†9´1"‘ßïVÞw_Æp‹0Ü6r�ŽS�áXí£ÃˆÄ*—L)F_E’�,f©ˆ­øÁÀTF§ài»—GÇò¯<[p’=ÃÚOž‚®e¹G§e*£ÖÖï5t³þu0êc¿lOÁpÑtþsBãþÍ¼ÎÓñ)˜\ó¹¨gzåE»+Úƒí5ïAùñÑÜ5Ù£    5   ˆl–Ým_J•2ÛR‚ ‚ Y¸Ø®µ1hß�þD&ÞY²47 Gh$óËƒy×ÅÊÂÍ "X    #!/usr/bin/perl
## -----------------------------------------------------------------------
##
##   Copyright 2002-2008 H. Peter Anvin - All Rights Reserved
##   Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
##
##   This program is free software; you can redistribute it and/or modify
##   it under the terms of the GNU General Public License as published by
##   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
##   Boston MA 02111-1307, USA; either version 2 of the License, or
##   (at your option) any later version; incorporated herein by reference.
##
## -----------------------------------------------------------------------

#
# Creates a blank MS-DOS formatted hard disk image
#

use bytes;
use integer;
use Fcntl;
use Errno;
use Cwd;
use IO::Handle;			# For flush()

sub absolute_path($) {
    my($f) = @_;
    my($c);

    return $f if ( $f =~ /^\// );
    $c = cwd();
    $c = '' if ( $c eq '/' );
    return $c.'/'.$f;
}

sub is_linux() {
    return !!eval '{ '.
	'use POSIX; '.
	'($sysname, $nodename, $release, $version, $machine) = POSIX::uname(); '.
	"return \$sysname eq \'Linux\'; }";
}
