LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 01: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, 01:11 PM   #2
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
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, 03:50 PM   #3
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
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



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 02:59 PM
1000+ Capitalized Directories Xerxes1121 Linux - General 1 06-17-2009 03:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:47 PM.

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
Open Source Consulting | Domain Registration