The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
need help with execl command walnut Shell Programming and Scripting 1 04-07-2006 01:52 PM
call execl with int as argument Dana73 High Level Programming 2 02-10-2006 05:42 PM
execl() bankpro High Level Programming 2 02-01-2006 12:48 PM
execv () vs execvp () hurleyint1386 UNIX for Dummies Questions & Answers 3 10-31-2005 09:27 PM
execl, execv or execp azran High Level Programming 1 04-22-2002 01:58 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-22-2006
owijust owijust is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 6
execl / execv ?

Hi,

Is it possible to run a program from my C program using only the full pathname?

for example if I wanna call: "ls", so I whould have to use:

Code:
execl("/bin/ls", "ls", NULL);

Is it possible to do this using only:
"/bin/ls"

thanks
  #2 (permalink)  
Old 01-23-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
You could use the system() function to run this. You wouldn't even have to give the full path if the executable is in your PATH.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:13 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0