Reputation: 10451
I have a Perl script that I run in Linux 64bit and it looks like this:
my $ret = `/my/cmd option1 option2 <(/my/cmd2 input)`
This works in bash, but when I try to execute the same command as a backtick in the Perl script, it complains:
sh: -c: line 0: syntax error near unexpected token `('
Any ideas?
Upvotes: 2
Views: 57
Reputation: 47127
I guess your /bin/sh
is not linked to bash, try:
my $ret = `bash -c '/my/cmd option1 option2 <(/my/cmd2 input)'`
You can check what /bin/sh
is linked to with:
% ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Apr 5 07:03 /bin/sh -> dash
Upvotes: 5