by goldenkey · 6y ago · 0 comments
On Windows: ren ∗.js ∗.mjs
On Unix: for x in ∗.js; do mv "$x" "${x%.js}.mjs"; done
Feels like shells should have one line list comprehensions without the obtruse do/done. Are there any shell enhancements like zsh or the like, that make simple list operations less verbose?
https://pubs.opengroup.org/onlinepubs/009695399/functions/re...
mv is basically just a shim over rename so I don't see your point.
Shell may be to glue things together but it's supposed to also be a decent language for doing file/filename related things.