Set the StrictHostKeyChecking
option to no
, either in the config file or via -o
:
ssh -o StrictHostKeyChecking=no username@hostname.com
I don't think a command or shell builtin for this exists, as it's a trivial subset of what the Bourne shell for
loop is designed for and implementing a command like this yourself is therefore quite simple.
Per JimB's suggestion, use the Bash builtin for generating sequences:
for i in {1..10}; do command; done
For very old versions of bash, you can use the seq
command:
for i in `seq 10`; do command; done
This iterates ten times executing command
each time - it can be a pipe or a series of commands separated by ;
or &&
. You can use the $i
variable to know which iteration you're in.
If you consider this one-liner a script and so for some unspecified (but perhaps valid) reason undesireable you can implement it as a command, perhaps something like this on your .bashrc (untested):
#function run
run() {
number=$1
shift
for i in `seq $number`; do
$@
done
}
Usage:
run 10 command
Example:
run 5 echo 'Hello World!'
Best Answer
rlwrap is a wrapper for GNU readline, so it's doing everything locally and only passing your input through after you press Enter. When you press Ctrl+] you don't see the
telnet>
prompt because readline has not yet sent your input.To kill your telnet connection, then, press Ctrl+], then q, then Enter.