lib/scripts/bash
author wenzelm
Mon, 10 May 2010 22:29:27 +0200
changeset 36789 076eded99ef7
parent 35024 0faeabd99289
permissions -rwxr-xr-x
Scala for Netbeans 6.8v1.1.0rc2;

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