Home | History | Annotate | Download | only in core

Lines Matching refs:command

31 #include <gpxe/command.h>
36 * Command execution
40 /* Avoid dragging in getopt.o unless a command really uses it */
45 * Execute command
47 * @v command Command name
49 * @ret rc Command exit status
51 * Execute the named command. Unlike a traditional POSIX execv(),
52 * this function returns the exit status of the command.
54 int execv ( const char *command, char * const argv[] ) {
55 struct command *cmd;
62 if ( ! command ) {
63 DBG ( "No command\n" );
67 DBG ( "%s: empty argument list\n", command );
71 /* Reset getopt() library ready for use by the command. This
78 /* Hand off to command implementation */
80 if ( strcmp ( command, cmd->name ) == 0 )
84 printf ( "%s: command not found\n", command );
89 * Expand variables within command line
91 * @v command Command line
92 * @ret expcmd Expanded command line
94 * The expanded command line is allocated with malloc() and the caller
97 static char * expand_command ( const char *command ) {
108 /* Obtain temporary modifiable copy of command line */
109 expcmd = strdup ( command );
159 * Split command line into argv array
161 * @v args Command line
165 * Splits the command line into whitespace-delimited arguments. If @c
166 * argv is non-NULL, any whitespace in the command line will be
195 * Execute command line
197 * @v command Command line
198 * @ret rc Command exit status
200 * Execute the named command and arguments.
202 int system ( const char *command ) {
208 args = expand_command ( command );
215 /* Create argv array and execute command */
231 * The "echo" command
247 /** "echo" command */
248 struct command echo_command __command = {