Question: How do I read from kb using shell script but I need to read it from same line?
echo "Please Enter Your Choice "
But it goes to next line I need it to read it next to Choice and not new line.
printf "Please Enter Your Choice "
echo -n "Please Enter Your Choice "
Question: csh exit while loop on keystroke
I'm using a `while(1)` loop to dispaly real-time information about various files on my system, and I use ^C to exit it when needed. I was hoping there was a way to exit the script on a normal keystroke such as "q".
Use a signal and have your script listen for the signal. The syntax depends on the shell you are using. If you are using ksh, see man ksh.
trap "command to run when signal trapped" "list of signals"
trap "" signals # Will trap the signals you define but not allow them to affect your script.
You can get a list of signals by typing kill -l on the command line. Note: You cannot trap signal 9. Your "command to run" can be a function if you so choose.
User Commands trap(1)
Have a Unix Problem
Return to : - Unix System Administration Hints and Tips
(c) www.gotothings.com All material on this site is