Is there any way in the shell script by which I can set the input line programmatically? Consider the following scenario.
Let's say I make a script to create a git branch, and right after it is done making a branch, I don't want to switch to new branch programmatically, but just give user the command displayed on the prompt, so user don't have to type the command to switch to new branch but only just press enter key if he wants to run the displayed command.
read -p "Enter your branch name: " N
git branch $N
render-text-on-prompt "git checkout $N"
Execution:
$ ./mkbranch
$ Enter your branch name: change-93
$ git checkout change-93 _