e.g.
Code: Select all
for i in !(*-out).txt
do
( echo "$i" ) &
done
If I use something like this:
Code: Select all
!(*-out).*
Is there a way to match 1 or more characters, or specifically exclude . and ..?
Without specifying every possible character in [] like this?:
Code: Select all
!(*-out).+([a-z])
I wanted to do stuff with the filename and the extension from the successful matches, and when a file had multiple extensions e.g. somefile.csv.txt I wanted to consider them all as one, not just take the last one as the extension.
Reading the docs at https://www.tldp.org/LDP/abs/html/param ... ution.html showed this is the solution:
Code: Select all
[do something with $i] >"${i%%.*}-out.${i#*.}"