System call doubt

Discussion in 'C' started by lyric, Nov 14, 2010.

  1. lyric

    lyric New Member

    Joined:
    Nov 14, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi, i didn't know what title to put so i put that one, sorry for not being clear.

    My problem is that i'm making my own shell, which uses the regular system commands, such as cd, ls, date,... and i'm looking for a way that it identifies !2 and executes the second command in the history, (the number is an example)
    I hace made some code in which it executes what i ask BUT in this form ! 2, and i need the ! to be next to the 2.
    I'm sorry i didn't explain myself.

    Anyone any idea?

    Thank you
     
  2. techgeek.in

    techgeek.in New Member

    Joined:
    Dec 20, 2009
    Messages:
    572
    Likes Received:
    19
    Trophy Points:
    0
    Occupation:
    EOC (exploitation of computers)..i m a Terminator.
    Location:
    Not an alien!! for sure
    Home Page:
    http://www.techgeek.in
    use command line argument programs in C i.e using argv and argc...name each program as "cd", "date" , "ls" etc etc...The shell will itself be your console or cmd screen....if any parameters is to be passed then pass it to argv and argc....
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice