On 9/26/2011 9:19 PM, Peng Yu wrote:
Hi,

I know that I should use =~ to match regex (bash version 4).

However, the man page is not very clear. I don't find how to match
(matching any single character). For example, the following regex
doesn't match xxxxtxt. Does anybody know how to match any character
(should be '.' in perl) in bash.

[[ "$1" =~ "xxx.txt" ]]



Looks good to me.

513 > regex='xxx.txt'
514 > [[ xxxxtxt =~ $regex ]]
515 > echo $?
0
516 >


--
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net

Reply via email to