Is there a way to have a shell script output text at the command prompt WITHOUT issuing the command?
CONTEXT: I SSH into a particular machine several times a day, and about 80% of the time, I type the same three commands as soon as I login. I would just put these commands in my .bashrc, but 20% of the time, I do NOT want to issue these commands. I'm wondering if there is some command I can put in .bashrc that will automatically put a string at my command line, so that when I login I see:
$ cd some/dir && ./some_script.sh
I could then just press enter 80% of the time or just clear the text the other 20% of the time.
ssh user@somehost "cd some/dir && ./some_script.sh"from your local computer work just as well?expectfor this, but that's just me.printcommand inzshcan do this:print -z 'cd some/dir && ./some_script.sh'. I don't think there is a way to execute arbitraryreadlinecommands (the relevant ones beingstart-kbd-macro,end-kbd-macro, andcall-last-kbd-macro).