Skip to content

Instantly share code, notes, and snippets.

@spiculator
Created May 26, 2014 13:30
Show Gist options
  • Save spiculator/6f00903ede0e88c3dd0a to your computer and use it in GitHub Desktop.
Save spiculator/6f00903ede0e88c3dd0a to your computer and use it in GitHub Desktop.
print command and run it (like `make` does)
#include <stdio.h>
int main(int argc, char **argv)
{
int i;
printf( "+" );
for( i = 1; i < argc; i++ )
printf( " %s", argv[i] );
printf( "\n" );
if( argc > 1 )
execvp( argv[1], argv + 1 );
}
@spiculator
Copy link
Author

It works like this:

root@l3:~# + echo Hi
+ echo Hi
Hi
root@l3:~#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment