Last active
July 19, 2020 18:57
-
-
Save andreasneuber/1566887cd1d864e6a2e9c076cfdc7bb9 to your computer and use it in GitHub Desktop.
Create simple Ruby Cli script - Ubuntu
This file contains hidden or 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
$ 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