linux - Shell user prompt (Y/n) -
I just wanted to write a small scripts to copy some files for my NAS, so I have shell-scripting . I know that many command line tools on Linux use the following sim for the Yes / No input
Do you know Yuri [Y / N] Where the letter indicates the standard verb which will be started by killing . Which is good for quick use. I also like to apply something like this, but I have some difficulty in caching the Enter key. This is what I have so far received: read -p "Are you sure? [Y / N]" Reaction Case $ [yy] Response [EE] [SS] | [Yay] | [JJ] | [# Insert coding here et #]) echo files will be echoed;; *) Echo canceld echo echo ;; esac Whatever I want I can add but it will not work with only enter .
Here's a quick solution:
read -p "what Are you sure? [Yi] [Yi] [EE] [ss] | [or y] | [jj] | '') resonant files will echo; *) echo echo echo echo; >
Comments
Post a Comment