Suppose that there are these files in my directory:
a1x
albtmk
axxxxx
blabla
bb
I would like to use ls based on some criteria and then print the output using echo. Criteria are:
- File name has three and more characters,
- file name starts on vowel,
- penultimate character is not a number.
So, desired output is albtmk axxxxx.
What I tried so far:
MYFILES=`ls a??* e??* i??* o??* u??* y??* A??* E??* I??* O??* U??* Y??*`
echo $MYFILES
I would like to ask:
- Can I combine
a??* e??* i??* o??* u??* y??* A??* E??* I??* O??* U??* Y??*together? - How can I form the condition penultimate character is not a number ? Somehow using regex?