Hi,
I'm very new in programming. The following task looks very simple but I don't know how to do it. Appreciate if anyone can give me some guidance.
I'm using Linux OS. I would like to create a CLI program and let the user run it in shell terminal. I plan to use Bash shell script to create this program, but C++ or Perl should be ok too. The CLI program will accept commands from the user, execute it, and then optionally show the result summary on the screen.
When the CLI program is running, I would like to make it always shows a "shell prompt" at the left-hand side of the shell terminal, just like the Bash shell prompt. The prompt indicates that the CLI program is waiting for the user to type in a command and press the return key.
[AAA@Bash user]$ # This is Bash shell
[AAA@Bash user]$./CliApp.sh
CliApp > # The CLI program is running, user can type in command here
CliApp > exit
[AAA@Bash user]$ # Now the user has returned to the Bash shell
I think I know how to print something on the screen and get inputs from the users, but I found that it looks very unprofessional. I believe that there is a better way to create this kind of program.
Can anyone give me some guidance how to create this kind of program? Appreciate if you can give me the links to any example program. Thanks.