lib/scripts/bash
author haftmann
Tue, 20 Jul 2010 06:35:29 +0200
changeset 37891 c26f9d06e82c
parent 35024 0faeabd99289
permissions -rwxr-xr-x
robustified metis proof

#!/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'/;