linux - [Solved-6 Solutions] How to prompt user for Yes No Cancel input in a Linux shell script - ubuntu - red hat - debian - linux server - linux pc
Linux - Problem :
How to prompt user for Yes No Cancel input in a Linux shell script ?
Linux - Solution 1:
To get user input at a shell prompt is the read command.
Here is the same example using select:
With select you don't need to sanitize the input – it displays the available choices, and you type a number corresponding to your choice. It also loops automatically, so there's no need for a while true loop to retry if they give invalid input.
Linux - Solution 2:
Linux - Solution 3:
You can use the built-in read command. Use the -p option to prompt the user with a question.
Related Searches to - linux - linux tutorial - How to prompt user for Yes No Cancel input in a Linux shell script
linux red hat debian opensuse ubuntu arch linux mandrake get link linux computer linux pc linux server linux desktop learn linux red hat linux red hat enterprise linux linux software linux tutorial linux operating system suse linux linux download linux os linux ubuntu vmware linux lunix linux windows linux news linux usb linux commands unix linux linux version what is linux linux centos linux ftp bash script yes or no promptbash script answer promptread user input in shell scriptbash script answer yesbash prompt for passwordshell script input argumentsbash read input from stdinhow to give input to shell script from command line