Skip to main content
edited tags
Link
Gilles 'SO- stop being evil'
  • 866.1k
  • 205
  • 1.8k
  • 2.3k

How to echo (a (executable-)string)(a (executable-)string) to the prompt to make the cursor sit at the end of the line?

So that iI can hit enterEnter to execute or ctrlCtrl-cC to throw away the line.

Is this possible at all?

I know an (interactive) bash-script would probably be nicer,
but i'd but I'd like to keep it simple.

Example:

echo_to_prompt "rm -R ./tmp/logs/delete_me_every_once_in_a_while/"

would result in:

user@machine:~$ rm -R ./tmp/logs/delete_me_every_once_in_a_while/[CURSOR]

Thank you.

How to echo (a (executable-)string) to the prompt to make the cursor sit at the end of the line?

So that i can hit enter to execute or ctrl-c to throw away the line.

Is this possible at all?

I know an (interactive) bash-script would probably be nicer,
but i'd like to keep it simple.

Example:

echo_to_prompt "rm -R ./tmp/logs/delete_me_every_once_in_a_while/"

would result in:

user@machine:~$ rm -R ./tmp/logs/delete_me_every_once_in_a_while/[CURSOR]

Thank you.

How to echo (a (executable-)string) to the prompt to make the cursor sit at the end of the line?

So that I can hit Enter to execute or Ctrl-C to throw away the line.

Is this possible at all?

I know an (interactive) bash-script would probably be nicer, but I'd like to keep it simple.

Example:

echo_to_prompt "rm -R ./tmp/logs/delete_me_every_once_in_a_while/"

would result in:

user@machine:~$ rm -R ./tmp/logs/delete_me_every_once_in_a_while/[CURSOR]
Source Link

How to echo (a (executable-)string) to the prompt, so that the cursor flashes at the end of the line?

How to echo (a (executable-)string) to the prompt to make the cursor sit at the end of the line?

So that i can hit enter to execute or ctrl-c to throw away the line.

Is this possible at all?

I know an (interactive) bash-script would probably be nicer,
but i'd like to keep it simple.

Example:

echo_to_prompt "rm -R ./tmp/logs/delete_me_every_once_in_a_while/"

would result in:

user@machine:~$ rm -R ./tmp/logs/delete_me_every_once_in_a_while/[CURSOR]

Thank you.