LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-03-2005, 09:12 PM   #1
geminigal
Member
 
Registered: Apr 2005
Posts: 53

Rep: Reputation: 15
can somebody please explain the "Exec", execlp


hi there.. i m still new to linux. Right now i having difficulties in understanding the exec function... eg: execlp. Can someone out there please explain this?

Prior to that, i m also facing problem in changing a bash command list which is "exec" into a programming code in which i would like to use for my coding function. in short, how to change the below command into a source code used in function?

at terminal:
exec vncviewer <ip>

at the source code
void F()
{
exec vncviewer <ip> //changed into functionable code
}

i had tried this but it failed together with the execlp.
 
Old 04-04-2005, 12:41 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
First off, you're getting two things confused:

exec in a shell is a shell builtin while execlp is a system call invoked from a program.

Basically the exec family of system calls executes a new program within your current process, i.e. the code your process uses is taken out and replaced with the code of the program you exec. In other words, a successful exec call does not return -- your program is terminated and the process begins running the code you exec.

The shell builtin does basically the same thing, the shell stops running and the program specified in exec runs instead.
 
  


Reply


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
No UTMPX entry, You must EXEC "login" for the lowest "shell" ooihc Solaris / OpenSolaris 7 03-12-2007 03:09 PM
Please explain "386" vs. "686" versions vinoloco Linux - Newbie 4 04-05-2005 08:03 PM
Can you explain the difference between "Free Software (GNU)" and "Open Source"? vharishankar General 5 03-03-2005 10:40 AM
"cannot exec `as': ..." AND "C compiler cannot create ..." pr3st0 Linux - Software 0 10-15-2004 01:42 PM
Execlp and "ln" command Spooky Programming 1 01-09-2004 10:26 AM


All times are GMT -5. The time now is 04:26 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration