This is the code snippet that I use in the below bash script:
for user_input in `awk '{print}' testfile_$$.txt` do ipaddress=`echo $user_input | cut -d';' -f 1` command="${config_mode}`echo $user_input | cut -d';' -f 2-`" ping -w 1 $ipaddress 1> /dev/null 2> $ERR_LOG_FILE 1> $LOG_FILE if [ $? -eq 0 ];then ssh " $USERNAME@ $ipaddress" "$command" >> $LOG_FILE fi done
how can i use to automate ssh login in this script.
I am very new to waiting and started testing this (it failed):
#!/usr/bin/bash set force_conservative 0 ;
I need to write a bash script again, waiting for the script, or expect it to be used inside the bash script if this can be done:
more i need to get the variable bash $ command , $ username , $ password , $ ipaddress and use it in the expected part
what solution would you suggest? or can I create the expected script and call it from a bash script only for login, error handling, execution, logfiles
source share