LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-20-2015, 02:08 PM   #1
superbbrr
LQ Newbie
 
Registered: May 2015
Posts: 3

Rep: Reputation: Disabled
Are you sure? [Y/n]. Why is the Y capitalized?


Here's another example:

Code:
read -r -p "Are you sure? [y/N] " response
case $response in
    [yY][eE][sS]|[yY]) 
        do_something
        ;;
    *)
        do_something_else
        ;;
esac
Why is the N capitalized here? Typing in n, N, or anything will result in *) being run. So [y/n] is the same thing as [y/N].
 
Old 05-20-2015, 02:11 PM   #2
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,008

Rep: Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621Reputation: 1621
It is capitalised because it is the default option -- in other words if you simply press <return> it will be selected. This is just the convention.
 
Old 05-21-2015, 04:50 PM   #3
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian
Posts: 1,054

Rep: Reputation: 276Reputation: 276Reputation: 276
If you press any of the keys in YES, any case, then the yes option is used. Any other response cancels everything. Therefore N is the default, and the capital N presented to the user indicates that. As 273 said, that's the accepted convention, and has been for as long as I've been involved in computers, 30 years or so.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Keyboard input gets capitalized intermittently - why ? rtspitz Linux - General 7 06-26-2011 03:59 PM
1000+ Capitalized Directories Xerxes1121 Linux - General 1 06-17-2009 04:06 AM


All times are GMT -5. The time now is 07:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration