Created
May 25, 2012 18:04
-
-
Save spannerinworks/2789543 to your computer and use it in GitHub Desktop.
Running a script on heroku and piping input and output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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