LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-07-2014, 11:43 AM   #1
sampappachan_nyc
Member
 
Registered: Jan 2009
Location: New York
Distribution: Red Hat, CentOS,Fedora, Ubuntu, SUSE, linux mint
Posts: 60

Rep: Reputation: 0
non case sensitive input for read utility


Hi,

How can I check the input I get through read utility while ignoring case sensitivity, ie.



echo " TRUE "
read -p "If this is TRUE, enter yes":
if [[ $REPLY != yes ]] }How would I check the read input here for yes, or Yes or YES etc...
then
echo "NOT TRUE"
else
echo "TRUE"
fi



Thanks
Sam
 
Old 11-07-2014, 02:03 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
http://nixcraft.com/showthread.php/1...xtended-string
 
1 members found this post helpful.
Old 11-07-2014, 02:06 PM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Just convert lower case letters to upper case, or reverse, after read but before the test.

There are several ways to do that, see e.g. a few here.
 
1 members found this post helpful.
Old 11-07-2014, 03:15 PM   #4
sampappachan_nyc
Member
 
Registered: Jan 2009
Location: New York
Distribution: Red Hat, CentOS,Fedora, Ubuntu, SUSE, linux mint
Posts: 60

Original Poster
Rep: Reputation: 0
Thanks Guys, this is awesome !
 
  


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
Apache 2.x case-sensitive jarias Linux - Newbie 2 05-15-2009 05:11 PM
Copying files from case-sensitive Linux to case-insensitive Windows via CIFS? SlowCoder Linux - General 4 05-07-2008 07:03 PM
is apache case-sensitive? browny_amiga Linux - Software 2 06-21-2004 01:57 PM
Why is linux case sensitive? Jestrik Linux - General 9 12-16-2003 07:05 AM
case sensitive groupadd? sysmaster Linux - General 0 07-28-2003 04:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:53 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
Open Source Consulting | Domain Registration