LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-04-2017, 12:15 PM   #16
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Distribution: Mint/MATE
Posts: 3,010

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287

Actually I came to the conclusion that within [ ] (character set) a single \ should suffice:
Code:
$ [[ 'wibble\' =~ [\.]$ ]]  &&  echo yes
yes
Certain bash versions (for example 3.2.25) have a bug here.
To also support them one can use \\ because
a buggy shell sees a \ and an okay shell sees two \ that is effectively the same as one \

The [*{\.}]$ matches any string that ends with * or { or \ or . or }.
 
  


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
bash for strange expansion doru Linux - Newbie 6 12-18-2014 03:48 PM
variable expansion in bash coolhandluke1 Programming 4 01-09-2008 04:45 PM
Variable expansion in BASH champak Programming 5 11-26-2007 03:44 AM
Bash variable string expansion Reginald0 Linux - Software 5 02-13-2007 11:38 AM
Bash variables expansion olaola Linux - Newbie 4 10-16-2006 12:45 PM

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

All times are GMT -5. The time now is 03:56 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