Hello all,

I am trying to create a wrapper script around perl scripts.  The
wrapper does some logging and then runs the perl script.  If I
explicitly run the wrapper script on my perl script it runs just fine:

$ /usr/bin/perl.sh hw.pl
hello world

If I chmod +x the script and try to run it as a stand-alone script, it
does not work:

$ ./hw.pl
./hw.pl: line 3: print: command not found

Here's the wrapper:

$ cat /usr/bin/perl.sh
#!/bin/bash
echo === date: $(date) command: "$@" "$(set)" >> /tmp/perl.log.txt
exec /usr/bin/perl  $@

Here's the script:

$ cat hw.pl
#!/usr/bin/perl.sh
print "hello world\n";

This seems to be a bash issue as the wrapper works just fine with bash
4.1.2 and 4.1.5 (CentOS 6.3 and Ubuntu 10.04).  But does not work with
bash 3.2.25 on Red Hat 5.8.

Any thoughts on a workaround?

Regards,
- Robert

-- 
Central West End Linux Users Group (via Google Groups)
Main page: http://www.cwelug.org
To post: [email protected]
To subscribe: [email protected]
To unsubscribe: [email protected]
More options: http://groups.google.com/group/cwelug

Reply via email to