0

whenever I try

irb(main):008:0> `while read FILENAME; do echo "Hi";done < <(cat /tmp/a)`

I get the following error:

sh: 1: Syntax error: redirection unexpected

Is there anyway to bypass this issue, but still use back ticks for the shell exec from ruby?

meso_2600
  • 1,940
  • 5
  • 25
  • 50
  • 2
    Can you show your script? Any references to bash there? – Nobita Aug 11 '14 at 00:40
  • 1
    I think @Nobita is likely correct. ruby is almost certainly defaulting to using `/bin/sh` and not `bash` and that is the cause of your problem. You need to use `bash` (or some other non-`sh`) script explicitly. – Etan Reisner Aug 11 '14 at 00:41
  • I could use 'system', but I need the output as well. – meso_2600 Aug 11 '14 at 08:44

0 Answers0