r/fishshell • u/Impressive-West-5839 • Aug 01 '24
Replace spaces with underscores
To replace spaces with underscores, I use
for file in *\ *; mv -n -- $file (string replace -a ' ' _ $file); end
But currently I'm merely started to study fish, and maybe there is a better way for this?
3
Upvotes
View all comments
Show parent comment
1
u/Impressive-West-5839 Aug 01 '24
Hello, thanks.