lib/scripts/bash
author huffman
Wed, 17 Feb 2010 09:22:40 -0800
changeset 35170 bb1d1c6a10bb
parent 35024 0faeabd99289
permissions -rwxr-xr-x
fix looping simp rule

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