Shell Programming

This is a discussion on Shell Programming within the C Programming forums, part of the General Programming Boards category; Hi All, In University we have been given the task of padding out an empty shell with the following commands ...

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    1

    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.

    Tristan

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    227

    Talking

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

    #!/bin/bash

    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...
    #!/bin/bash
    or
    #!/bin/ssh

    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.....

    http://neworder.box.sk/bash.tutor.php
    enjoy...

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    227
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,506
    > We have been given the shell and simply have to add the commands to it
    Well

    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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21