Thread: need a bit knowledge...

  1. #1

    Wink need a bit knowledge...

    i really want to creat something like a shell programm.. and i want to know how i can make this ----> [xlord@xlord]# stay in the program..
    like for example if i was to type in "ls" or "cat" well i want it go go back to
    [xlord@xlord]#. Unless i wanted it to show filez when i was going to do
    [xlord@xlord]# ls ... but all i want is to make it go back to the shell..

    thanx... if anyone can help me start this.. if not thanx anyway..

  2. #2
    Registered User
    Join Date
    Aug 2001
    just create an infinite loop that keeps spitting that out as a command line.

    scanf("%c", &chr);

    if( chr == 'q') break;

    that way you provide youirself an out in case you need to escape back to the shell.


  3. #3
    ok i have done what you said and when i type in 'q' to exit the program...
    what happendz is it prints the shell again.. and if i was to do qq it will print it twice... hhmm..

  4. #4
    Code Warrior
    Join Date
    Nov 2001

    Thumbs up

    If you have problems with your code than post it.
    Current projects:
    1) User Interface Development Kit (C++)
    2) HTML SDK (C++)
    3) Classes (C++)
    4) INI Editor (Delphi)

  5. #5
    Registered User
    Join Date
    Mar 2002
    87 - Portfolio site

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. porting application from 32 bit to 64 bit error
    By gandalf_bar in forum Linux Programming
    Replies: 1
    Last Post: 09-14-2005, 09:20 AM
  2. Bit processing in C
    By eliomancini in forum C Programming
    Replies: 8
    Last Post: 06-07-2005, 10:54 AM
  3. Porting from 32 bit machine to 64 bit machine!
    By anoopks in forum C Programming
    Replies: 10
    Last Post: 02-25-2005, 08:02 PM
  4. Bit Manipulation Questions
    By CPPNewbie in forum C++ Programming
    Replies: 7
    Last Post: 08-12-2003, 02:17 PM
  5. Array of boolean
    By DMaxJ in forum C++ Programming
    Replies: 11
    Last Post: 10-25-2001, 11:45 PM