Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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....???

  2. #2
    This should be sufficient IMHO:

    ls *.ele

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts