Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-04-2017, 11:15 AM   #16
Senior Member
Registered: Dec 2011
Location: Simplicity
Posts: 2,049

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917

Actually I came to the conclusion that within [ ] (character set) a single \ should suffice:
$ [[ 'wibble\' =~ [\.]$ ]]  &&  echo 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 }.


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

All times are GMT -5. The time now is 02:41 PM.

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