GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
parse_cmd(3) FreeBSD Library Functions Manual parse_cmd(3)

#include <xtend/proc.h>
-lxtend

char    *parse_cmd(char *argv[], const char *cmd)

argv:   Pointer array to be filled with command tokens
cmd:    Raw command string with limited meta-character support
from strshellcpy(3)

Breaks a shell command into an argv[] style array suitable for spawnvp() or execv*(). A copy of cmd is created using strshellcpy(), which expands certain shell features such as variables and paths starting with '~'. The copy is then modified by replacing separators with '0' and the argv[] array is populated with pointers to each token in the copy.

Pointer to strdup() copy of cmd, which should be freed as soon as possible when argv[] is no longer needed.

char *cmd, *argv[], *expanded_cmd;
expanded_cmd = parse_cmd(argv, cmd);
spawnvp(P_WAIT, P_NOECHO, argv, NULL, NULL, NULL);
free(expanded_cmd);

spawnvp(3), spawnlp(3), exec(3)


Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.