Became Hot Network Question
3 Enhanced.
source | link
function mv1 { mv -n $1"$1" "targetdir" -v |wc -l ;}
mv1 *.png

It does only move the first .png file it finds, not all of them.

How can I make the command apply to all files that match the wildcards?

function mv1 { mv -n $1 "targetdir" -v |wc -l ;}
mv1 *.png

It does only move the first .png file it finds, not all of them.

How can I make the command apply to all files that match the wildcards?

function mv1 { mv -n "$1" "targetdir" -v |wc -l ;}
mv1 *.png

It does only move the first .png file it finds, not all of them.

How can I make the command apply to all files that match the wildcards?

2 edited tags; edited tags
source | link
function mv1 { mv -n $1 "targetdir" -v |wc -l ;}
mv1 *.png

function mv1 { mv -n $1 "targetdir" -v |wc -l ;} mv1 *.png It It does only move the first png.png file it finds, not all of them.

How can I make the command apply to all files that match the wildcards?

How can I make the command apply to all files that match the wildcards?

function mv1 { mv -n $1 "targetdir" -v |wc -l ;} mv1 *.png It does only move the first png file it finds, not all of them.

How can I make the command apply to all files that match the wildcards?

function mv1 { mv -n $1 "targetdir" -v |wc -l ;}
mv1 *.png

It does only move the first .png file it finds, not all of them.

How can I make the command apply to all files that match the wildcards?

1
source | link

Why does a file move/copy function only move one file at a time when using the “*” wildcard?

function mv1 { mv -n $1 "targetdir" -v |wc -l ;} mv1 *.png It does only move the first png file it finds, not all of them.

How can I make the command apply to all files that match the wildcards?