Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-03-2005, 08:12 PM   #1
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-03-2005, 11:41 PM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
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.


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 02:09 PM
Please explain "386" vs. "686" versions vinoloco Linux - Newbie 4 04-05-2005 07:03 PM
Can you explain the difference between "Free Software (GNU)" and "Open Source"? vharishankar General 5 03-03-2005 09:40 AM
"cannot exec `as': ..." AND "C compiler cannot create ..." pr3st0 Linux - Software 0 10-15-2004 12:42 PM
Execlp and "ln" command Spooky Programming 1 01-09-2004 09:26 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:02 PM.

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