Live data from Hacker News

Dt: Duck tape for your Unix pipes

dt.plumbing

131–140 of 162 posts

Re: Dt: Duck tape for your Unix pipes

#131
post #65

Earlier quoted context omitted.

> Null separators between fields is structured data. It might just be the simplest that can possibly work (because the null character is outside the normal data range for text, unlike the newline, which demonstrably doesn't work in that sense) but it is structure. A list structure, specifically. Sometimes I daydream about a parallel universe in which the designers of Unix decided on record-oriented IO instead of stre…

Sometimes I daydream about a parallel universe in which the designers of Unix decided on record-oriented IO instead of stream-oriented IO. I would attack you with tea bags and waxed paper, if you tried to alter the timeline, and make this so. On the other hand, I would happily sing your praises, if you invented another kind of pipe, to your specs, it sounds like a great additional. Imagine combining the two, in one s…

> On the other hand, I would happily sing your praises, if you invented another kind of pipe, to your specs, it sounds like a great additional

Already exists - Unix domain sockets. Some shells (in particular some versions of ksh) use them to implement pipes. And, on some platforms (Linux yes, but I think maybe not macOS???) Unix domain sockets support record-oriented operation (SOCK_SEQPACKET). The problem is that for it to work you don’t just need the kernel to support it and the shell to use it, you also need all the utilities to support it too-that’s a big ask.

The idea has been implemented on IBM mainframes (CMS pipelines aka Hartmann pipelines). But that’s a radically different platform, and IBM has never tried porting that to a non-mainframe platform, and nobody has ever sought to directly clone it (although stuff like PowerShell and NuShell share some of its ideas, albeit none of the details)

Re: Dt: Duck tape for your Unix pipes

#132

Earlier quoted context omitted.

I'm talking about how the term was used in the studios I was exposed to. Even in that article, the two definitions are very, very close to being the same thing, and in the studios I was familiar with, both of the tapes the article defines would have been referred to as "gaffer's tape". They're just different varieties of gaffer's tape. It's all just slang, though, so I'm not surprised that the definition varies from…

Just ask KaTe Bush.

Or her Usenet fan group.

Damn, that neuron hasn't lit up since about 1992.

Re: Dt: Duck tape for your Unix pipes

#133

I either use Bash (which is actually a decent programming language if you spend the time to learn it properly) or Python.

> Bash (which is actually a decent programming language) How so? I tried to seriously learn Bash a few days ago, and once I learned about word splitting, [[ ]] vs. [ ], "${MY_VAR}" just to properly reference a variable it seemed even more full of technical debt that Wat-full [1] Javascript. I figured it would be obsoleted by a modern shell language alternative by the time I will be 30 (currenty 18), it's not worth it…

Learning a programming language properly usually takes 5 years of daily practice using it to solve real problems.

There is no 'wat' situation for a tool you really are proficient with.

Re: Dt: Duck tape for your Unix pipes

#134

Earlier quoted context omitted.

Nope, duct tape is for ducts and can't be made of cloth because the water would clearly seep through the cloth. There are strings in duct tape but not cloth. The part I quoted says that duck tape is made of cloth and therefore is not duct tape. I think people get confused because there is a brand of duct tape named Duck Tape. But even the Duck Tape packaging calls it a "duct tape".

> Nope, duct tape is for ducts and can't be made of cloth because the water would clearly seep through the cloth. There are strings in duct tape but not cloth. I am sorry, but you are wrong. The term duct tape is specifically referring to “Duct tape: cloth- or scrim-backed pressure-sensitive tape, often coated with polyethylene.” We don’t even need to argue if it is good for use in ducts, it is not, I agree. However,…

Honestly I think we're elaborating more than needed, I won't die on this hill :)

Re: Dt: Duck tape for your Unix pipes

#135

Earlier quoted context omitted.

Or like "Apple" as a brand name for... nevermind

ever since i read the story about the "Max Headroom" guys about how they picked their name (because it was written at the entrance of every parking garage) i think the best way of naming a company is to make it something that is said hundreds of times by people every day "an apple a day" etc... wonder if I can name my comapny "the The company" or "the corporation of Is" haha

> wonder if I can name my comapny [sic] "the The company"

https://en.wikipedia.org/wiki/LaCie

Re: Dt: Duck tape for your Unix pipes

#136
post #36
post #30

Earlier quoted context omitted.

The Unix philosophy doesn't dictate any specific data format to interoperate between commands, besides this being data streams, and typically text. Commands are free to interpret these streams however they want, which is why this seems like "hodgepodge", but in no way were tools breaking any sort of promise. FWIW I've been using *nix machines for decades, and very rarely have I had the need to use structured data bet…

> but in no way were tools breaking any sort of promise The Unix philosophy as usually stated includes the rule "write programs that work together". Most Unix commands don't work together in any meaningful sense. For example, `ps | kill` will not terminate all processes, as one might naively expect. I'd say this is a clear violation of both the letter and the spirit of the Unix philosophy.

kill `ps`

rm `ls`

kindof work

Re: Dt: Duck tape for your Unix pipes

#137

Earlier quoted context omitted.

> Nope, duct tape is for ducts and can't be made of cloth because the water would clearly seep through the cloth. There are strings in duct tape but not cloth. I am sorry, but you are wrong. The term duct tape is specifically referring to “Duct tape: cloth- or scrim-backed pressure-sensitive tape, often coated with polyethylene.” We don’t even need to argue if it is good for use in ducts, it is not, I agree. However,…

Honestly I think we're elaborating more than needed, I won't die on this hill :)

You know what. In retrospect I have no idea why I cared so much and got so aggressive. I apologize for that. Cheers.

Re: Dt: Duck tape for your Unix pipes

#138

Earlier quoted context omitted.

Presumably it's meant to be used when you're writing a shell script and you have some problem in front of you that would be trivial to solve in a real programming language and you find yourself saying a sentence starting with "I just wanna…" and rage-googling or asking ChatGPT or whatever.

My read as well. I write shell-scripts when the current tools solve the problem easily. I distribute shell scripts to colleagues (never customers) only when I absolutely do not want to install extra software on their system. I avoid awk and perl because if I'm going to introduce a second language to a tool, I'm not going to pick the niche ones everyone only learns opportunistically if at all. At that point I'd rather…

Awk and Perl niche? How about "reliably installed on every GNU/Linux box this side of the century". Their fault for not knowing their own systems. Anything pre-installed is fair game.

Re: Dt: Duck tape for your Unix pipes

#139

I either use Bash (which is actually a decent programming language if you spend the time to learn it properly) or Python.

> Bash (which is actually a decent programming language) How so? I tried to seriously learn Bash a few days ago, and once I learned about word splitting, [[ ]] vs. [ ], "${MY_VAR}" just to properly reference a variable it seemed even more full of technical debt that Wat-full [1] Javascript. I figured it would be obsoleted by a modern shell language alternative by the time I will be 30 (currenty 18), it's not worth it…

There is a zero percent chance that Bash will be gone by the time you're 30. I recommend you use some of that youthly neuroplasticity of yours to get used to it; it is too valuable a skill to give up on simply because it's "wat-full". It is in part a valuable skill to have precisely because it is "wat-full".

Re: Dt: Duck tape for your Unix pipes

#140

Earlier quoted context omitted.

Null separators between fields is structured data. It might just be the simplest that can possibly work (because the null character is outside the normal data range for text, unlike the newline, which demonstrably doesn't work in that sense) but it is structure. A list structure, specifically. The world would be a much happier place if -print0 (or whatever) was universal, but no such luck.

> Null separators between fields is structured data. It might just be the simplest that can possibly work (because the null character is outside the normal data range for text, unlike the newline, which demonstrably doesn't work in that sense) but it is structure. A list structure, specifically. Sometimes I daydream about a parallel universe in which the designers of Unix decided on record-oriented IO instead of stre…

What if most standard Unix commands had a new option to insert into their output those nifty separators ? (FS, GS, RS, US)

That ought to make life simpler for downstream commands that try to go beyond processing a text stream.

Post reply on HN