Thread: Shell Programming

  1. #1
    Registered User
    Join Date
    Feb 2002

    Shell Programming

    Hi All,

    In University we have been given the task of padding out an empty shell with the following commands ls, pwd, ps, kill and cd.

    We have been given the shell and simply have to add the commands to it, being fairly unfamiliar with C and Shells in general I would really appreciate it if somebody could point me in the right direction !

    Thanks you so much for taking the time to read this, look forward to any help.


  2. #2
    Registered User
    Join Date
    Dec 2001


    well learning shell are simple but then again ther not .. i can give you a someple one


    echo "type in your dir"
    read my_dir
    cd $my_dir

    this little bay will take you to the dir that you have requested..
    in every shell your programming should alwayz start with this...

    now i know you know what echo is.. but just in case it meanz
    print this to the screen... then the read.. meanz read input frome user
    and surely you know what is cd.. bash is great and it make thingz easyer for you... anywayz here is a tut.....

  3. #3
    Registered User
    Join Date
    Dec 2001
    oopppps i think you want something else... but this is what i did ..

    i readed a calc compiled it and then added it to sbin... now if i have a math problem all i do is /sbin/math and wuala

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    > We have been given the shell and simply have to add the commands to it

    fgets will read a line in

    strcmp allows you to compare that line with your list of words. If there's a match, do whatever it is you're supposed to do

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 34
    Last Post: 05-27-2009, 12:26 PM
  2. What shell is more powerful?
    By xddxogm3 in forum Tech Board
    Replies: 10
    Last Post: 07-24-2004, 10:47 PM
  3. System.ini Shell Problems
    By (TNT) in forum Windows Programming
    Replies: 2
    Last Post: 08-26-2001, 01:05 PM