Find the answer to your Linux question:
Results 1 to 2 of 2
hi... i'm running a simple user created shell. I have a main prog which forks and calls execvp() for all commands in it.. all commands seem to be working fine. ...
  1. #1
    Just Joined!
    Join Date
    Jun 2009
    Posts
    1

    sh: clear : command not found !!!

    hi... i'm running a simple user created shell. I have a main prog which forks and calls execvp() for all commands in it.. all commands seem to be working fine. but i'm not able to use system("clear") command. i'm getting
    sh: clear : command not found.
    (where clear is a executable file in pwd created using the same system("clear").) but if i try ./clear then that perticular module works correctly just like ./ls or ./cat etc all being executable file.
    i have also set the environmental variable using setenv("PATH","/home/prajwal/shellfiles",1); can u plz tell me why i'm not able to use clear?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,977
    'clear' is normally found in /usr/bin, so if you have changed your PATH environment as shown, it won't find it. You need to include /usr/bin in your PATH. Since prefacing the command with the current directory, as in ./clear, seems to work, I suspect your working directory is /usr/bin.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...