On Sat, May 13, 2017 at 07:46:08AM -0500, John McKown wrote:
> find "${dat0}" -mindepth 1 -maxdepth 1 -type f -regexptype egrep -regex
> '.*[0-9]$' | xargs -I {} cp -a {} "${dat1}"
Why would you use
-regexptype egrep -regex '.*[0-9]$'
when you could simply (and portably!) use
-name '*[0-9]'
That said, with -mindepth 1 and -maxdepth 1, it looks like you are not
recursing at all. So you could just use a glob.
cd "$someplace" || exit
for file in *[0-9]; do
base=${file%[0-9]}
whatever "$file" "$base"
....
done