Skip to content

Instantly share code, notes, and snippets.

@spannerinworks
Created May 25, 2012 18:04
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 spannerinworks/2789543 to your computer and use it in GitHub Desktop.
Save spannerinworks/2789543 to your computer and use it in GitHub Desktop.
Running a script on heroku and piping input and output
Don't expect pretty, it's a hack...
We need and END marker on the input because we have to tell the script to exit
$ cat > input.txt
a quick brown
fox jumple over the
laszy dog
END
$ heroku run "perl -pe 'exit if /^END$/; s/(\w)/\1\1/g;'" < input.txt > output.txt
$ cat output.txt
Running `perl -pe 'exit if /^END$/; s/(\w)/\1\1/g;'` attached to terminal... up, run.2
a quick brown
fox jumple over the
laszy dog
END
aa qquuiicckk bbrroowwnn
ffooxx jjuummppllee oovveerr tthhee
llaasszzyy ddoogg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment