News for hackers. Stuff that matters.
Re:Unix Wildcards Gone Wild (2014) by LukeShu on Saturday June 23, 2018 @10:53AM (#17381519)
Good mention! I knew that realpath is a relatively new addition to GNU coreutils, but I didn't realize that older Debians had an incompatible implementation of it.

With a single $(realpath ...), chomping the trailing newline is fine, as realpath will insert a trailing newline after the filename; but definitely something to be aware of with other commands.

Re:Unix Wildcards Gone Wild (2014) by jwilk on Saturday June 23, 2018 @11:08AM (#17381592)
Newline in realpath (and many other commands) output is mostly for aesthetics. It doesn't help with taming $(), because $() strips all trailing newlines, including the ones that were actually part of the pathname. You would have have to resort to something as ugly as:

   f=$(realpath ... && printf 'x')
   f=${f%x}