Re:The Beauty of Unix Pipelines
by 6gvONxR4sf7o on Thursday June 04, 2020 @05:19PM
(#23421936)
God help you if your paths have spaces in them.
[ Parent
| on HN ]
No need to invoke a deity to do that...
echo 'Hi!' | tee "$(printf "foo\nbar\tqu ux.txt")"
cat foo$'\n'bar$'\t'qu' 'ux.txt
IIRC the latter only works in ksh93+, but the former should be fine pretty much in any shell.... except if one uses \c by mistake. \c has unspecified behaviour, and is one of the things that varies widely from one implementation of printf to another.
By “God” you may mean “libc”...
...if it was the 1970s. Nowadays we use Python etc for tools where it’s less acceptable for them to fall apart, though everything falls apart at some point, spaces or otherwise.
[dead]
Re:The Beauty of Unix Pipelines
by bananabreakfast on Thursday June 04, 2020 @08:18PM
(#23423635)
Don't you mean Raku? lol
Re:The Beauty of Unix Pipelines
by naniwaduni on Thursday June 04, 2020 @09:12PM
(#23423992)
Perl 5 was more suitable for these particular use cases than perl 6 ever tried to be.
Perl5 was and is amazing. Check the articles from
https://linuxfocus.com and the old Linux Gazzete magazines from TLDP: https://linuxgazette.net/archives.html.
Just quote paths? shrug
Try doing that in e.g. Make
In the early 2k's I discovered that it was impossible to quote or escape spaces in filepaths in a makefile. I naively reported it to the Make maintainer as a bug.
The maintainer responded by saying, basically, that the behavior was deeply baked in and was not going to change.
This is a nice feature of make. People who put spaces on filenames are justly punished by not being given the goodness of make.
I can't tell if you're being sarcastic but this can result in innocent users who don't even know this fact to suddenly overwrite or wipe their files when trying to build someone's project.
Nobody is innocent if they have filenames with spaces in their systems! /s
Try finding out which registry key you need to edit to get something to happen.
Some things across different systems have pitfalls as a result of their implementation, or some features have pitfalls. There are half a dozen things I can point to on windows that are worse than the "spaces in filenames". Hell, windows doesn't even support ISO 8601 dates, or times to be properly placed in files. It restricts symbols much more than Linux / Unix
who said anything about windows?
The parent thread referenced windows as something that handles spaces in filenames. I'm not sure why I'm getting downvoted when my comment was relevant to the debate occurring, and my point (that all features have downfalls caused by the necessity of implementation within the surrounding system, and in the case of command line arguments, linguistics and common keyboards themselves) is something that according to the guidelines should be debated against, not downvoted.