Nov 30, 2012

[bash] extended pattern matching bash

shopt -s extglob

man shopt



?(pattern-list) Matches zero or one occurrence of the given patterns

*(pattern-list) Matches zero or more occurrences of the given patterns

+(pattern-list) Matches one or more occurrences of the given patterns

@(pattern-list) Matches exactly one of the given patterns

!(pattern-list) Matches anything except one of the given patterns

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.