Skip to content

Instantly share code, notes, and snippets.

@happyrobots
Created August 3, 2011 14:59
Show Gist options
  • Select an option

  • Save happyrobots/1122836 to your computer and use it in GitHub Desktop.

Select an option

Save happyrobots/1122836 to your computer and use it in GitHub Desktop.
http://user-contributions.org/wikis/userwiki/index.php?title=Bash-to-Ruby
http://www.grymoire.com/Unix/Sed.html
http://www.thegeekstuff.com/2009/12/unix-sed-tutorial-6-examples-for-sed-branching-operation/
http://www.catonmat.net/blog/sed-one-liners-explained-part-one/
http://www.catonmat.net/blog/awk-one-liners-explained-part-one/
http://sed.sourceforge.net/local/docs/emulating_unix.txt
http://www.eng.cam.ac.uk/help/tpl/unix/sed.html
Ruby:
File.read('somefile.txt').split("\n").join(" ")
Bash:
sed -e :a -e '$!N; s/\n/ /; ta' somefile.txt
http://www.satimage.fr/software/en/tutorial/tutorial_as2.html
on run argv
--return "hello, " & item 1 of argv & "."
set c to {"green", "red"}
set x to {"Agnes", "Albert", "Bad News", "Bahh", "Bells", "Boing", "Bruce", "Bubbles", "Cellos", "Deranged", "Fred", "Hysterical", "Junior", "Kathy", "Pipe Organ", "Princess", "Ralph", "Tri noids", "Victoria", "Whisper", "Zarvox"}
say "Build is green"
repeat with i from 1 to (length of x)
set rn to (random number from 1 to 2) as text
say "Build is " & (item rn of c) using (item i of x)
end repeat
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment