sh scripting question

Polytropon freebsd at edvax.de
Fri Oct 16 13:05:58 UTC 2020


On Thu, 15 Oct 2020 23:14:13 -0400, Kurt Hackenberg wrote:
> On 2020-10-15 23:05, Bob Proulx wrote:
> 
> > Oh you are tormenting us now.  :-)  There are some subtle issues here.
> 
> 
> Maybe a shell is the wrong tool.

No, it's not, it's just not as trivial as if the filenames
would have been "normalized", i. e., if they wouldn't use
reserved (but valid!) characters such as spaces. :-)

I have dealt with this kind of torture many times already,
and I'm quite happy I have a script that "normalizes"
filenames for further use, if this is possible and
allowed; if not, there are specific precautions you 
have to observe in your sh code. The common "for f in *; do
... bla $f ... done" just doesn't work anymore.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list