lib/scripts/bash
author wenzelm
Tue, 25 May 2010 21:49:44 +0200
changeset 37118 ccae4ecd67f4
parent 35024 0faeabd99289
permissions -rwxr-xr-x
eliminated slightly odd Library/Library session setup (cf. d7711be8c3a9) which is obsolete due to usedir -f HOL_Library_ROOT.ML;

#!/usr/bin/env perl
#
# Author: Makarius
#
# bash - invoke shell command line (with robust signal handling)
#

use warnings;
use strict;


# args

my ($group, $script_name, $pid_name, $output_name) = @ARGV;


# process id

if ($group eq "group") {
  use POSIX "setsid";
  POSIX::setsid || die $!;
}

open (PID_FILE, ">", $pid_name) || die $!;
print PID_FILE "$$";
close PID_FILE;


# exec script

exec qq/exec bash '$script_name' > '$output_name'/;