Forum Archive

Simple shell

edgauthier

The start of a simple shell for basic file management. Currently supports the following commands (no support for any options at this point):

  • ls
  • pwd
  • cd
  • mkdir
  • rm (handles both directories and files)

By default, the script tries to protect the user from altering files outside of the Documents directory. To disable these preventative checks, add a setting to the config dict:

config = {'allow_unsafe': True}

https://gist.github.com/4063716

pantazi64

cool

omz

Very nice! I've added some error handling and a cat command:

https://gist.github.com/4066688

pudquick51

You've got a bug in your do_rm re-implementation, omz

if len(args == 0):

should be

if len(args) == 0:

PKHG222

Indeed, I changed my copy ;-)

omz

Thanks, fixed.