I am wondering if it is possible to create a program on the on the command line of the raspberry pi, like you would tell it to run a program and then it asks for you to provide an input. Is that possible?
I am wondering if it is possible to create a program on the on the command line of the raspberry pi, like you would tell it to run a program and then it asks for you to provide an input. Is that possible?
standard c program or script or python
google "C" programming command line program and you will find plenty to learn from
If you want to call a program from your program( in C ) you can try these,
system() - this will the command you specifies as argument and returns once that program is completed.
Ex : system( "ls" );
popen() - this can be used when you want to read the output of the executed program or input any options to the program but not both. Its much like you are dealing with files. Try 'man popen' from your command terminal for more info.
execl() - these can also be used for starting an external program. Try 'man exec' for complete range of options.
If you are looking to implement command line args in your C-program, you can find a good tutorial here - Anatomy of command line arguments in Linux
If you are using python, check this : Python os.popen() Method