lib/scripts/bash
author haftmann
Thu, 12 Aug 2010 17:56:43 +0200
changeset 38394 3142c1e21a0e
parent 35024 0faeabd99289
permissions -rwxr-xr-x
moved Record.thy from session Plain to Main; avoid variable name acc

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