I am unable to pass Enter key stroke to shell script. Tried all options, but no luck.
Please help..
Script: bkpscript.sh
tam01# ./bkpscript.sh < file.txt
Mount volume 1 on /dev/rmt0.
Press Enter to continue.
tam01#
tam01#
tam01#
tam01# echo "" |./bkpscript.sh
Mount volume 1 on /dev/rmt0.
Press Enter to continue.
tam01#
tam01#
tam01# ./bkpscript.sh < file.txt
Mount volume 1 on /dev/rmt0.
Press Enter to continue.
tam01#
tam01#
tam01# yes " " | head -1 | ./bkpscript.sh
Mount volume 1 on /dev/rmt0.
Press Enter to continue.
tam01#
tam01# echo -ne '\n' | ./bkpscript.sh
Mount volume 1 on /dev/rmt0.
Press Enter to continue.
It would be very helpful if you posted the script, but at a minimum we would need to know the command that actually calls the backup process to write to tape.
This could be tar, cpio, fsdump, fsbackup, savevg, exp (Oracle) ontape (Informix) or loads of others and they may not accept an externally called ENTER, i.e. they ignore any queued input. There may be a flag to make it non-interactive, but there are so many choices at the moment it would be futile to suggest anything.
You may be able to trawl through the mksysb script and find where it does backbyname and find where that leads you. I don't have an AIX server available at the moment.
You might also get away with forcing the extra ENTER like this:-