Writing a Shell

The new project in the OS class is to write a java based shell emulation. I’m excited – this sounds like a really fun assignment. In fact, it just seems a wee bit easy. All you really need to do is to parse user input and traverse the file system.

Requirements are really easy – do include equivalents of ls, mkdir, cd and date, keep history of n most recently used commands, and m most recently visited directories. Not much else. Sounds like cake…

What I really want to explore is to mimic pipes and input/output redicection, and letting the user to execute native programs by using Javas Runtime exec method. It also doesn’t seem that difficult if you think about it.

Dr. Robila reccomended that those who can’t figure this assignment out can allways attempt to buy code from zewrestler who was the only person in class who managed to implement this last semester. Hehe…

This entry was posted in Uncategorized. Bookmark the permalink.



2 Responses to Writing a Shell

  1. ZeWrestler UNITED STATES says:

    ?*stands up and takes a bow*

    stnndard price for that code. ussual routine, first born child and a new jag.

    but the UML i made for it, i’ll give out for free (if i can find it) lol

    enjoy that was a fun project. if you decide that you want to expand that shell afterwards let me know, the rediection and pipes sounds fun.

    Reply  |  Quote
  2. Psht, that project a C one-liner!

    int main () { execl("/bin/sh", (void *)0); }

    Just pipe that into gcc and call it a day. ;-)

    echo 'int main(){execl("/bin/bash",(void*)0);}' | gcc -xc -o lukesh -

    Reply  |  Quote

Leave a Reply

Your email address will not be published. Required fields are marked *