I am trying to do something like this
ruby test.rb | source /dev/stdin
where test.rb just prints out cd /
. There are no errors, but it doesn't do anything either. If I use this:
ruby test.rb > /tmp/eraseme2352; source /tmp/eraseme2352
it works fine, but I want to avoid the intermediate file.
Edit: The whole point of this is that the changes need to persist when the command is done. Sorry I didn't make that clearer earlier.