Live data from Hacker News

The Beauty of Unix Pipelines

prithu.xyz

331–340 of 388 posts

Re: The Beauty of Unix Pipelines

#331

Earlier quoted context omitted.

At Goldman, the internal language Slang has spaces in variable names. It's insane at first glance and I got into an argument with my manager about why in the world this was acceptable, and he could give me no other answer than "this is the way it is". But when you realize that space isn't a valid separator between token, seeing things like "Class to Pull Info From Database::Extractor Tool" actually becomes much easie…

> I was on your side until I tried it, but it can actually be quite useful, esp. if everything is consistent. On my side? You cannot imagine how extreme one can be... If I had my way, programming languages would only allow single-letter variables and space would be the multiplication operator.

What possible justification could you have for making this mandatory?

Math notation being dependent on single-character names is an artifact of "concatenation as multiplication" -- which in my opinion is a useful but sloppy historical convention with little merit or relevance in non-handwritten media.

Re: The Beauty of Unix Pipelines

#332

Earlier quoted context omitted.

At Goldman, the internal language Slang has spaces in variable names. It's insane at first glance and I got into an argument with my manager about why in the world this was acceptable, and he could give me no other answer than "this is the way it is". But when you realize that space isn't a valid separator between token, seeing things like "Class to Pull Info From Database::Extractor Tool" actually becomes much easie…

> I was on your side until I tried it, but it can actually be quite useful, esp. if everything is consistent. On my side? You cannot imagine how extreme one can be... If I had my way, programming languages would only allow single-letter variables and space would be the multiplication operator.

Okay - I wasn't meaning to pick a fight here. Just saying that there are definite use cases where spaces in variable names can work and actually be useful. That's all.

Re: The Beauty of Unix Pipelines

#333

Earlier quoted context omitted.

Yeah, any unicode character is OK on a filename, except maybe space and slash.

I don't think C0 or C1 controls should be allowed in filenames. Why allow them? And they potentially pose security issues. With some, admittedly somewhat obscure [1][2], terminal emulators, C0 and C1 controls can even be used to execute arbitrary code. You could say these terminal emulators are insecure, and you may well be right, but the fact is they exist. [1] See for example page 211 of https://static.zumasys.com/…

I agree. Personally I think the Linux kernel should have a compilation-time option to disallow various special characters in filenames such as ASCII control characters and colons, so users who want to maintain a sane system can give themselves the option to do so.

Re: The Beauty of Unix Pipelines

#334

Earlier quoted context omitted.

I don't think C0 or C1 controls should be allowed in filenames. Why allow them? And they potentially pose security issues. With some, admittedly somewhat obscure [1][2], terminal emulators, C0 and C1 controls can even be used to execute arbitrary code. You could say these terminal emulators are insecure, and you may well be right, but the fact is they exist. [1] See for example page 211 of https://static.zumasys.com/…

I agree. Personally I think the Linux kernel should have a compilation-time option to disallow various special characters in filenames such as ASCII control characters and colons, so users who want to maintain a sane system can give themselves the option to do so.

and spaces! ;)

Re: The Beauty of Unix Pipelines

#335

Pipes are wonderful! In my opinion you can’t extol them by themselves. One has to bask in a fuller set of features that are so much greater than the sum of their parts, to feel the warmth of Unix: (1) everything is text (2) everything (ish) is a file (3) including pipes and fds (4) every piece of software is accessible as a file, invoked at the command line (5) ...with local arguments (6) ...and persistent globals in…

> (1) everything is text And lists are space-separated. Unless you want them to be newline-separated, or NUL-separated, which is controlled by an option that may or may not be present for the command you're invoking, and is spelled completely differently for each program. Or maybe you just quote spaces somehow, and good luck figuring out who is responsible for inserting quotes and who is responsible for removing them…

Works for me.

Re: The Beauty of Unix Pipelines

#336

Earlier quoted context omitted.

I'm not going back to CamelCase or underscores for my normal day to day file naming. The problem with spaces only exists inside the IT world and it's something they should find a way around.

I agree. The file load/save dialogs of all GUI should work in such a way that spaces typed by the users in a filename field are always transparently changed to something different (for example, the unicode non-breaking space).

Sounds like taking the "I know better than the users to another level".

Re: The Beauty of Unix Pipelines

#337
post #176

Earlier quoted context omitted.

Going with the same theme, C itself was an innovation meant to fill the space between Assembler (in this context, "A") and B[0]. [0] https://en.wikipedia.org/wiki/B_(programming_language)

That isn't really supported by the article you linked -- it describes C as an extension of B multiple times.

I only linked that because most people don't know what B is, and I suppose the difference between "innovation meant to fill the space" and "extention" wasn't so important to me.

My source for the claim itself is from 14m30s of Brian Cantrill's talk "Is It Time to Rewrite the Opersting System in Rust" https://youtu.be/HgtRAbE1nBM

Re: The Beauty of Unix Pipelines

#339

Earlier quoted context omitted.

I don't think C0 or C1 controls should be allowed in filenames. Why allow them? And they potentially pose security issues. With some, admittedly somewhat obscure [1][2], terminal emulators, C0 and C1 controls can even be used to execute arbitrary code. You could say these terminal emulators are insecure, and you may well be right, but the fact is they exist. [1] See for example page 211 of https://static.zumasys.com/…

I agree. Personally I think the Linux kernel should have a compilation-time option to disallow various special characters in filenames such as ASCII control characters and colons, so users who want to maintain a sane system can give themselves the option to do so.

So um, how would you work with files that came from a foreign file system? Would the kernel just crash when it sees them? Would they be effectively untouchable, like filenames with a '/' encoded in them?

Re: The Beauty of Unix Pipelines

#340
post #123

I think it will be on topic if I let myself take this occasion to once again plug in a short public service announcement of an open-source tool I built, that helps interactively build Unix/Linux pipelines, dubbed "The Ultimate Plumber": https://github.com/akavel/up/ I've also recently seen it being described in shorter words as a "sticky REPL for shell". Hope you like it, and it makes your life easier!

I'm surprised this doesn't get up-voted. The tool automates very nicely my shell command writing process: pipe one step at a time and check the incremental results by using head to get a sample. Looks cool to me!
Post reply on HN