News for hackers. Stuff that matters.
Re:Filenames and Pathnames in Shell: How to Do It Correctly by emmelaich on Monday June 19, 2023 @11:55PM (#36399511)
Does this work as desired?

    "$(dirname "$file")"
Is $file not actually quoted here? Since the quoted bits are

    "$(dirname "
    ")"
Re:Filenames and Pathnames in Shell: How to Do It Correctly by two_handfuls on Tuesday June 20, 2023 @12:04AM (#36399571)
This will correctly nest the quotes, yes. It’s somewhat counter-intuitive, but it works.
Re:Filenames and Pathnames in Shell: How to Do It Correctly by coldtea on Tuesday June 20, 2023 @05:32AM (#36401632)
>It’s somewhat counter-intuitive, but it works.

Sums up the POSIX shell experience

Re:Filenames and Pathnames in Shell: How to Do It Correctly by layer8 on Tuesday June 20, 2023 @05:42AM (#36401702)
One might disagree about “it works”.
Re:Filenames and Pathnames in Shell: How to Do It Correctly by gpvos on Tuesday June 20, 2023 @03:32AM (#36400816)
$() is a quote, like ``, and the "$file" is entirely within it, so it should work.
Re:Filenames and Pathnames in Shell: How to Do It Correctly by emmelaich on Tuesday June 20, 2023 @07:51PM (#36412414)
Thanks. I had thought the " quote was parsed / used much earlier in the tokenisation for sh.