LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 10-24-2004, 12:57 PM   #1
antjf
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
antjf
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
quentusrex
Member
 
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.
 
  


Reply



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 LinuxQuestions.org Member Intro 0 05-16-2003 09:53 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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