Results 1 to 2 of 2
I want to match all filenames having a specific extension which is to be input by the user.
I tried
read ele # ele is the extension like txt,csv,log,doc,etc...
ls ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-15-2010 #1Just Joined!
- Join Date
- Oct 2008
- Posts
- 4
Match input pattern with awk
I want to match all filenames having a specific extension which is to be input by the user.
I tried
read ele # ele is the extension like txt,csv,log,doc,etc...
ls -l | nawk -v z="\.$ele" '$9 ~ z {print}'
But it does not work.
Can anybody help....???
- 11-15-2010 #2Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
This should be sufficient IMHO:
Code:ls *.ele


Reply With Quote
