Im writing a script to collect micro code levels for adapters on each servers in AIX, using Expect shell.
#!/bin/kshfor hostname in ABCD123 ABCD234 ABCD445doexpect << 'EOS'set hos {$hostname}spawn ssh padmin@$hostnameexpect "Password:"send "ABC1234\n"expect "$"send "oem_setup_env\n"expect "#"send "lsmcode -A | sed -e 's/^/$hos: /'\n"expect "#"send "exit\n"expect "$"send "exit\n"EOSdone
But unfortunately the script fails to run. Can you please help me
Output should be like this
ABCD123 : sys0!system:CL320_040 (t) CL320_040 (p) CL320_040 (t)ABCD123 : ent0!14101103.CN0110ABCD123 : ent1!14101103.CN0110ABCD123 : ent2!14101103.CN0110ABCD123 : ent3!14101103.CN0110ABCD123 : ent4!14108802.DV0210