LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   get full path of a command (in C) (https://www.linuxquestions.org/questions/linux-software-2/get-full-path-of-a-command-in-c-117961/)

Hady 11-19-2003 05:19 PM

get full path of a command (in C)
 
Hi!

I'm trying to write a very simple shell in C that
Prompts the user for a command,
Parses the command line,
Execute the command while passing to it the arguments passed on the command
line.

say the desired command is in variable cmd

How can i get the full path of this specific cmd??

(anything like path = getenv("PATH"); ??)

Thank you for your time.

Hady

trickykid 11-19-2003 05:46 PM

Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php

I moved your other one into programming where its more suitable.


All times are GMT -5. The time now is 11:04 AM.