mainThe 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

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

Add a New Comment Rich Markup
   

Tue 17 Jan 2023 09:20:47 PM UTC, comment #2: 

It seems easy enough to do something like Martin suggests.

Chet Ramey <chet>
Group administrator
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:
   
   
Comment:
   

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 chet (Posted a comment)
  • -email is unavailable- added by kurahaupo (Posted a comment)
  • -email is unavailable- added by elfring (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-17 chet StatusNone Wont Do

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code