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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -