[ale] One for systemd haters

Lightner, Jeffrey JLightner at dsservices.com
Wed Oct 10 10:18:24 EDT 2018


"valid" and "reasonable" are two different things in my view.   

You may have "valid" reasons to cuss out your great grandmother but almost no one else hearing you do so will consider it "reasonable".

While it is true shell expansion can cause unexpected behaviors, creating a file with such a name is completely unreasonable even if allowed.    There are many characters one might put in a file name that most of us know not to do because of their special meanings.    Usually when one finds such a bizarre filename it is because of some typo or other action that added weird characters - not intent.   Typically if I find such files I verify they're not in use and delete them.  I couldn't do that in this case as it was clearly intended to exist.

"your [developers] were so preoccupied with whether or not they could, they didn't stop to think if they should."

-----Original Message-----
From: Solomon Peachy [mailto:pizza at shaftnet.org]
Sent: Tuesday, October 09, 2018 2:36 PM
To: Lightner, Jeffrey; Atlanta Linux Enthusiasts
Subject: Re: [ale] One for systemd haters

On Tue, Oct 09, 2018 at 06:23:29PM +0000, Lightner, Jeffrey via Ale wrote:
> As an FYI the “-“ at start of file name doesn’t just affect 
> grep/egrep.  Any command that tries to look at * in a directory will 
> have the issue because it expands that “-“ as if it were an additional 
> flag to the command issued rather than just the start of a file name.

The thing is, leading '-' is perfectly legal for a POSIX filename.  
Which is why getopt and other bog-standard cmdline parsing libraries implement the special '--' option to signify that subsequent arguments are filenames rather than options.

This quirk of shell wildcard expansion/ambiguity isn't anything new, especially to anyone who has had to work with real-world-supplied filenames.

 - Solomon
-- 
Solomon Peachy			       pizza at shaftnet dot org
Coconut Creek, FL                          ^^ (email/xmpp) ^^
Quidquid latine dictum sit, altum videtur.


More information about the Ale mailing list