Skip to content

Instantly share code, notes, and snippets.

@nygrenh
Created August 19, 2016 12:04
Show Gist options
  • Save nygrenh/e375fbd967f16699bd45e190048ed8e2 to your computer and use it in GitHub Desktop.
Save nygrenh/e375fbd967f16699bd45e190048ed8e2 to your computer and use it in GitHub Desktop.
Simplest possible shell, written in Ruby
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