Created
August 19, 2016 12:04
-
-
Save nygrenh/e375fbd967f16699bd45e190048ed8e2 to your computer and use it in GitHub Desktop.
Simplest possible shell, written in Ruby
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
loop do | |
print "#{Dir.pwd} $ " | |
command = gets.chomp | |
if command.start_with? 'cd ' | |
Dir.chdir command.split[1] | |
else | |
puts `#{command}` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment