Skip to content

Instantly share code, notes, and snippets.

@johnallen3d
Last active October 15, 2015 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnallen3d/b1c1e6c9b7884b96e00d to your computer and use it in GitHub Desktop.
Save johnallen3d/b1c1e6c9b7884b96e00d to your computer and use it in GitHub Desktop.

Process Substitution Error in IRB

simple example of process substitution in shell (bash)

> echo <(true)
/dev/fd/11

now with Ruby (IRB) - note: Ruby is shelling out to /bin/sh not /bin/bash

> `echo <(true)`
sh: -c: line 0: syntax error near unexpected token `('

try using bash inside a Ruby sub shell

> `/bin/bash -c "echo <(true)"`
=> "/dev/fd/63\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment