helpThe GNU Bourne-Again SHell - Support: sr #109352, Working with a determined file...


sr #109352: Working with a determined file list from a folder without referencing the selected directory

Submitted by:  Markus Elfring <elfring>
Submitted on:  Tue 18 Jul 2017 11:51:04 AM UTC  
Category:  None Priority:  5 - Normal
Severity:  1 - Wish Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  None

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 31 Dec 2021 06:36:54 AM UTC, comment #1: 

It seems like you want a shorthand for

LIST=( /some/dir/*some*pattern* )
do_something_with "${LIST[@]##*/}"

Is there a use case where a shorter version would be justified?

Does it have to be part of the glob syntax per se?

Martin D Kealey <kurahaupo>
Tue 18 Jul 2017 11:51:04 AM UTC, original submission:  

Pathname expansion is supported as a general functionality. It is often used together with pattern matching. If a directory was specified in the pattern, the name will be copied to the matching result so far.

I would like to clarify the possibility to omit the selected directory from the generated file list.

How do you think about to support a pattern matching variant where only basenames will be returned?

Markus Elfring <elfring>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by kurahaupo (Posted a comment)
  • -email is unavailable- added by elfring (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.7