There is no need to invoke 'grep' here. Just use 'bash'.
To match two alphabetic characters as the pattern use [a-zA-Z][a-zA-Z] or alternatively [[:alpha:]][[:alpha:]].
To match 0 or more characters as the pattern use *.
To match "e" as the pattern use e.
To match 0 or more characters as the pattern use *.
With extended globbing enabled, to match 1 or more alphabetic characters as the pattern use +([a-zA-Z]) or alternatively +([[:alpha:]]).
Pattern matching syntax in 'bash' is different to regular expression syntax in 'grep'.
Last edited by allend; 10-06-2017 at 05:45 PM.
|