William Park via talk wrote on 2024-03-21 18:27:

for I in *.sh ; do mv ${I} ${I%%.sh} done

That will change 'x.sh' to 'x' without trailing dot.

Exactly what's desired.


Ubuntu/Debian distros will include 'rename' where you can use regex.
How does `rename` (a Perl program, I believe?) handle globbing and pathname expansion?


i.e. in a folder with 3 files: one.sh, two.sh, file.tar, typing:

rename *.sh *

means rename gets passed these parameters:

one.sh two.sh one.sh two.sh file.tar


I'd be curious how they handle that (I expect requiring params to be quoted).


Thanks

rb
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk

Reply via email to