Can you use the line continuation character Code: \ ? Put this as the last char and the shell will wait for a next line. But I'm not sure I understand your question correctly.
what i want my script to do is: to ssh to a remote server check sshd_config for AuthorizedKeysFile check if there is ~/.ssh copy public key from original host ~/.ssh/*pub to a remote host ~/`grep AuthorizedKeysFile /etc/ssh/sshd_config | awk '{print $2}'` and i dont want to type password 2-3 times, i want this to be done in one line so i only have to type password once
Escape your own special characters by placing a '\' in front of each to be escaped character, so something like Code: ssh user@hostname "command1 --arg1 \"xx\" && command2 && command3 [...]"
You can do if/for ect.. statements on one line by separating statements with a semi-colon Code: if [ -f tmp.txt ] ;then echo "yep.. that is a file";fi same thing when doing a for statement on one line. Code: for i in 1 2 3; do echo $i;done