News for hackers. Stuff that matters.
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.
Re:The Beauty of Unix Pipelines by mfontani on Thursday June 04, 2020 @07:57PM (#23423473)
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.
Re:The Beauty of Unix Pipelines by JdeBP on Friday June 05, 2020 @03:19AM (#23425897)
... 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.

* https://unix.stackexchange.com/a/558665/5132

Re:The Beauty of Unix Pipelines by gorgoiler on Thursday June 04, 2020 @05:31PM (#23422091)
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.
Re:The Beauty of Unix Pipelines by anthk on Friday June 05, 2020 @08:04AM (#23427527)
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.
Re:The Beauty of Unix Pipelines by bityard on Thursday June 04, 2020 @05:43PM (#23422233)
Just quote paths? shrug
Re:The Beauty of Unix Pipelines by mehrdadn on Thursday June 04, 2020 @06:18PM (#23422648)
Try doing that in e.g. Make
Re:The Beauty of Unix Pipelines by blacksqr on Thursday June 04, 2020 @07:33PM (#23423277)
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.

Re:The Beauty of Unix Pipelines by enriquto on Friday June 05, 2020 @12:44AM (#23425156)
This is a nice feature of make. People who put spaces on filenames are justly punished by not being given the goodness of make.
Re:The Beauty of Unix Pipelines by mehrdadn on Friday June 05, 2020 @01:14AM (#23425301)
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.
Re:The Beauty of Unix Pipelines by enriquto on Friday June 05, 2020 @02:08AM (#23425537)
Nobody is innocent if they have filenames with spaces in their systems! /s
Re:The Beauty of Unix Pipelines by fao_ on Thursday June 04, 2020 @07:13PM (#23423090)
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

Re:The Beauty of Unix Pipelines by yzmtf2008 on Thursday June 04, 2020 @09:35PM (#23424135)
who said anything about windows?
Re:The Beauty of Unix Pipelines by fao_ on Friday June 05, 2020 @07:01PM (#23434975)
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.
Re:The Beauty of Unix Pipelines by yzmtf2008 on Friday June 05, 2020 @07:53PM (#23435332)
None of the parents of your comment mentioned Windows. Perhaps you have the wrong thread?