Skip to content

Instantly share code, notes, and snippets.

@andreasneuber
Last active July 19, 2020 18:57
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 andreasneuber/1566887cd1d864e6a2e9c076cfdc7bb9 to your computer and use it in GitHub Desktop.
Save andreasneuber/1566887cd1d864e6a2e9c076cfdc7bb9 to your computer and use it in GitHub Desktop.
Create simple Ruby Cli script - Ubuntu
$ sudo apt-get -y update
$ sudo apt-get -y install ruby
$ echo 'export PATH="$PATH:$HOME/bin"/' >> ~/.bashrc
$ sudo touch /bin/allgood && sudo chmod 755 /bin/allgood
$ sudo nano /bin/allgood
# Then add this into the "allgood" file
--------------------------------------------
#!/usr/bin/env ruby
puts 'All is good today!!! Also on...'
ARGV.each do |arg|
puts arg
end
--------------------------------------------
# Save with CTRL+O , ENTER, CTRL-X
# Usage:
$ allgood Monday Tuesday
# Should give you:
=> All is good today!!! Also on...
Monday
Tuesday
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment