I would like to programmatically put a certain piece of text in the command line buffer of bash, read to be edited and used as a command.
What I am looking forward to is something similar to read -i
but for commands.
-i text
If readline is being used to read the line, text is placed into the editing buffer before editing begins.
Edit: With programmatically I mean that want to write this in a script, launch the script and have the command buffer prepared or the command history modified (as some questions have suggested).
screen
can do this for you. – strugee Jul 12 '13 at 02:27