News for hackers. Stuff that matters.
Re:Filenames and Pathnames in Shell: How to Do It Correctly by chasil on Tuesday June 20, 2023 @08:41AM (#36403167)
The flaw in your reasoning is that a minimal POSIX shell, in the form of dash, compiles to less than 100k bytes on 32-bit x86.

Not of the other technologies that you did or might mention exhibit this property.

Korn features were explicitly excluded to meet this goal in the standard.

Re:Filenames and Pathnames in Shell: How to Do It Correctly by vesinisa on Tuesday June 20, 2023 @09:19AM (#36403539)
There's also the set & setting that is good to consider. For example, I bet lots of the scripts in my current employer's DevOps infrastructure have filename handling bugs that could've been avoided by meticulously following these rules. But these scripts are not meant to be used by customers - the people using these scripts are other developers working on the product wanting to set up the development environment. The script might fail if you do some stupid / unexpected stuff, even as simple as having a space in your Unix user name (i.e. home directory path) or VCS clone directory.

I would feel weak from the knees if someone exposed these scripts on a web server and let them process input from untrusted external parties. Yet, I don't care if the scripts aren't 100% perfect if they work as long as the user doesn't do something silly. Plus, many of them are portable meaning you can run them out of the box on Linux, MacOS or WSL (Windows) without installing any extra software.

Re:Filenames and Pathnames in Shell: How to Do It Correctly by wodenokoto on Tuesday June 20, 2023 @11:11AM (#36405153)
I have literally never worked on a computer where that would make a noticeable difference.

I am however struggling with those footguns regularly.

Re:Filenames and Pathnames in Shell: How to Do It Correctly by chasil on Tuesday June 20, 2023 @11:53AM (#36405877)
I actually used Microsoft Xenix on 80286 "minis" early in my career.

The 64k limit for the text segment of a compiled C program is likely a large factor in the POSIX shell standard; it seems designed to fit architectures similar to this.

The Korn shell was included in later versions of Xenix, but I understand that the source code was an unmaintainable mess, hence the removal of features in the final standard for the shell language.

Re:Filenames and Pathnames in Shell: How to Do It Correctly by aragilar on Wednesday June 21, 2023 @05:03AM (#36416157)
Most home routers have < 16MB of space.
Re:Filenames and Pathnames in Shell: How to Do It Correctly by sudosysgen on Tuesday June 20, 2023 @11:53AM (#36405898)
Micropython will compile to much less than 100k bytes on x86, too.
Re:Filenames and Pathnames in Shell: How to Do It Correctly by chasil on Tuesday June 20, 2023 @03:02PM (#36408883)
You should try to get that into Busybox!
Re:Filenames and Pathnames in Shell: How to Do It Correctly by aragilar on Wednesday June 21, 2023 @04:59AM (#36416127)
But is micropython installed on my router (POSIX shell is)?