shell command for pausing
Hi,
Is there a shell command that will "sleep" until a key is pressed (similar to getch() in C)? Thanks, Toshi |
You can use:
read -n1 Or slightly better: read -sn1 -p "Press any key to continue..." |
Thanks,
read works fine in bash, but what about csh and tcsh ? I would appreciate any help, Toshi |
I don't tend to write anything in shells other than bash but you could always start bash to run it:
bash -c "read -sn1" If you want something that will work in all shells then you'll need an additional program such as pak.c: Code:
#include <stdio.h> |
Thanks a lot!
bash -c "read -sn1" is perfect. Toshi |
All times are GMT -5. The time now is 12:03 AM. |