in reply to Re: How to include bash functions file in Perl?
in thread How to include bash functions file in Perl?

Sorry, I am a forum novice. Thanks your example did the trick. I wanted to make use of existing functions in a bash script. The particular function renamed for backup purposes existing log files. Below is the corrected problem area:

my $sysTestLib="$HOME/bin/test/library/libsystemtest.ksh"; # Systest +libraries my $libFunc; # Systest Libray function variable if (-e $RESULTS) { $libFunc="libHandleFileName -f $RESULTS"; # System Test Library +Function $renameRes = system(bash => ("--rcfile" => "$sysTestLib", -i, -c => + "$libFunc" ) ); }

Replies are listed 'Best First'.
Re^3: How to include bash functions file in Perl?
by ikegami (Patriarch) on May 19, 2010 at 20:46 UTC
    sub text_to_sh_lit { my ($s) = @_; $s =~ s/'/'\\''/g; return "'$s'"; } my $cmd = ( join ' ', map text_to_sh_lit($_), libHandleFileName => ( -f => $RESULTS, ) ); $renameRes = system( bash => ( "--rcfile" => $sysTestLib, -i, -c => $cmd, ) );