Linux – How to enter a bash script at the command line, but not process the script until the entire script has been entered

bashcommand-line-interfacelinuxscripting

I am performing some interactive testing using HP's QuickTest Professional and Linux. I am connecting via SSH and feeding the BASH script lines directly into the command line.

The problem I'm having is that the script executes as it is entered. I'm attempting to find a way that I can feed the script to the command line, but save execution until the entire script is complete.

Anyone have any experience around doing this? I'll admit, it isn't the ideal way to perform this, but it's what I'm faced with at the moment. Any other suggestions are welcome.

Thanks!

Best Answer

If you really can't write a script file to the system, you could wrap your commands in parenthesis:

 ( ls; echo this; echo that; )

same deal, multiline:

(
ls
echo this
echo that
)