5 ms·
It gets rid of the goldarn blanks in the filenames.
by tosseraccount 11y ago
It gets rid of the goldarn blanks in the filenames.
- anc84 11y agofor file in *.txt; do mv "${file}" "${file// /}"; done
- tosseraccount 11y agoWellIdidnotknowthat.thanks!
- jaytaylor 11y agoOff-topic: Wow thanks, I didn't know about that form of bash variable substitution! It's documented under the heading: ${var/Pattern/Replacement} at http://www.tldp.org/LDP/abs/html/parameter-substitution.html http://www.tldp.org/LDP/abs/html/parameter-substitution.html
- mahouse 11y agoBlanks in the filenames are a problem? Is this MS DOS 6?
- fnordfnordfnord 11y agoThey're at least annoying for some people to deal with.
- scbrg 11y agoSince space is the standard argument separator in most shells, yes, obviously. The problem can be worked around/handled in various ways, but it's still a problem, of course.
- pdkl95 11y agoBlanks are only a problem for people that haven't read bash(1). Once you learn to simply use "$@" everywhere, you never worry about blanks again.