I want my program(ksh) to execute further only if the return key is pressed.
Please help.
i have already tried "\n", "\r", "^M" .
Thanks in advance
I want my program(ksh) to execute further only if the return key is pressed.
Please help.
i have already tried "\n", "\r", "^M" .
Thanks in advance
Aik,
See if this is what you want:
echo "Press enter to continue."
read mGarbage
Try this:
Control will go inside if block only if return is pressed.
#!/bin/ksh
echo "Press Enter"
IFS="\n"
read enterkey
if [[ -z $enterkey ]];then
print "This is printed only for return key"
fi