I appologize. It should be argv[1]. I don't know what I was thinking.
Anyway, here's code for you:
#include <iostream>
#include <string.h>
#include <stdio.h>
using namespace std;
int main(int argc, char *argv[])
{
if(argc>1)
{
if(strcmp(argv[1], "-d") == 0)
{
system( "echo Date: `date`" );
}
}
else
{
system( "echo Date: `date`" );
system( "echo Uptime: `uptime`" );
system( "echo Name: `uname -n`" );
system( "echo Kernel: `uname -r`" );
}
}
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower
|