Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-24-2004, 12:57 PM   #1
LQ Newbie
Registered: Oct 2004
Location: Deep inside the Portuguese North
Distribution: Fedora Core 2
Posts: 9

Rep: Reputation: 0
Help a noob programmer - Access the $PATH

Hello all.

I'm a college student currently assigned to build a small shell for a Linux OS. Nothing really fancy like Bash, but I need to access the $PATH env variable so I'm able to use those common commands like cd or ls. The code is being built using C (compiling with gcc), so I could really use some help in has how I can, everytime a non absolute command is given, search through the directories listed in $PATH.

The man on the function execlp states that it already does this, but i'm not getting any results. Am I doing anything wrong?

BTW, I'm not only a noob programmer, but a Linux noob also :P 1st post...

Thx in advance.
Old 10-24-2004, 01:20 PM   #2
LQ Newbie
Registered: Oct 2004
Location: Deep inside the Portuguese North
Distribution: Fedora Core 2
Posts: 9

Original Poster
Rep: Reputation: 0
Ah, forget about it. 2mins after I posted, I re-re-re(...)-re-read the man page on execlp. I just neede to specify the PATH as an arg to the function...

Gotta learn to read ALL the words.
Old 10-24-2004, 01:24 PM   #3
Registered: Aug 2004
Location: Seattle, Washington
Posts: 101

Rep: Reputation: 15
Haha, that happens to too many of the best of us. It is awesome that you were re-re-re-reading the man pages. This shows that you are interested in finding the answer not just having someone here give it to you.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmer to Programmer ( Long Story Of A GUI ) mdoubledragon Programming 1 10-13-2005 05:41 PM
NOOB: how to access other computers?? wwnexc Linux - Networking 8 10-07-2005 05:56 PM
[SOLVED] noob with httpd-access.log (Attempting to Crack me?) kwlskwlguy Linux - Security 6 08-10-2005 06:47 AM
PATH (noob) problem:) wilu Linux - Newbie 1 06-30-2005 02:05 PM
Former MS Access programmer jdtiede Member Intro 0 05-16-2003 09:53 AM > Forums > Non-*NIX Forums > Programming

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration