45 comments

[ 4.8 ms ] story [ 105 ms ] thread
They should have called the tool "gato" (Spanish for "cat")...
and the rust version of cat should have been called "rat" instead of "bat"
The go version could also be called "fat", given the size of go binaries ;)
Similar to https://github.com/sharkdp/bat but Go instead of Rust
A missed opportunity to name it `rat`.
Flying rat > Earthbound rat

Besides, this way I can type 'man bat' and scowl.

Totally off-topic, but: flying rats are so cute. I didn't realize that until we started getting some that would hang in the alcove, above our door, in the summer occasionally. They aren't really a threat either. As long as you don't go out of your way to bug them, they just sleep cozily. The button noses are great.
If I read the command `gat myfile` I would definitely assume you were trying to delete it with prejudice.

I would be surprised to see it print to my terminal.

Edit: why downvotes? You can’t use words as commands that invoke a completely different set of connotations than the commands execution does

Given that a `gat` has both an input-side and an output-side, I think it resembles `cat` reasonably well. I'd expect some kind of buffering difference so that the output is "faster" than the input in some way.
Why delete?
"gat" is slang for "shoot and kill (with a gun)"
Looks like the connotation in your head is really obscure, because the downvoters (I'm guessing), a sibling commenter, and I are wondering why "gat" could mean "delete"?
The dictionary definition of "gat" is "revolver", does that really qualify as "obscure"?

Anyways, in terms of usage I've heard, it is almost exclusively implying you'll brandish and/or apply your gun, maybe this part is more obscure, but if I wrote "stab myfile" I don't think you'd expect me to put the contents in a buffer.

Well I had to check the dictionary to see what you mean.

"stab" would be obvious, but maybe someone needs to go out and ask 100 or a 1000 people on the street what they think of when they hear the word "gat", and maybe then you can congratulate yourself for being in an exclusive minority.

I assure you, gat is a common slang, most Americans on the street would be able to tell you that it's a gun.
Perhaps it's not fully mainstreamed, but looking at the current conversation it looks to me like the idea is widespread. Really though, I also see no other other usages of the term online, it surprises me you would not simply type in "gat" to a search engine and easily understand my point.
There's dictionary definition and there's well known usages. In the dictionary "retard" means to slow down or hinder, but if I said "Stop retarding my progress", a "mainstream person" would probably be offended.

Anyway, to end the discussion, I guess the downvotes have other causes, and it'll remain a mystery to both of us.

That’s exactly what I’m saying. There IS no other usage of “gat”, just look online, it exclusively is referring to guns. What kind of counter argument is an incorrect analogy misstating something already spoken?

Wish you had ended it a comment earlier.

> "stab" would be obvious

Obviously converts spaces to tabs.

What would you expect "wall ~/documents" to do?

I don't really find that command names reliably relate to words. Offhand none of these would do what I expect: curl, top, git, gawk. less is a more featureful more, and who knows what an xxd is. Certainly not a dead four eyed monster with its tongue hanging out.

stab is probably Send To A Buffer, just like grep is Global Regular Expression Print

I always stay strapped with Gat.
Great to have alternatives, but wish there was a “Why” section in readme
Right, does it do things faster? Or somehow more efficiently?

It seems that this is probably slower and consumes far more resources than cat. It also does pretty printing and syntax highlighting. From a Unix standpoint, I would say this is not a cat replacement but a pretty replacement.

I just tried both gat and bat to see if they could really replace cat (spoiler: they cannot — unlike cat they soak up all input before outputting anything, and crash with out of memory very quickly).

A cat alternative would have to handle this correctly:

  $ </dev/zero cat >/dev/null
or it's not really a cat alternative. (Yes, variations on this theme are very useful in scripts and daily shell hacking).
Wow, I would expect handling streaming properly to be the default case
(comment deleted)
I would be curious to see how it compares to similar tools: https://github.com/sharkdp/bat/blob/master/doc/alternatives....
Nitpick about bat: it bothers me that they call it a drop in cat replacement. It is not.

But it's a very useful tool that I use often.

I'm not familiar with ccat but at a quick glance it does not appear to be a drop in cat replacement either.

(comment deleted)
Both gat and bat seem more like a replacement for less, not cat to me!
Has anyone made a "cat" like tool that uses treesitter under the hood?
cat -v is ”harmful”

but this is fun, well done!