That's a really good catch. Didn't notice it my first time watching it. I suppose that either way it beats the old method but that's very weird to do that to the test.
Well, based on the speed of the needle and what I know of damped motion because of the generation of eddy currents that did not at all look like the same thing.
It's been the source of a lot of headaches for me (specifically: windmill cogging), there is no way that that needle stopped in the way it did in the video.
Agree, I've also seen other comments that note this getting removed. I'm now shadowbanned from commenting on the video. It would be great if more people noted this issue so that some of them might not be moderated and blocked.
The damage from a frozen water line in your house can be a lot more than $4000.
We had them when I was still a kid in the sixties and I did not like it at all. Jumping in a warm bed is nice but leaving it on during the night makes you wake up all sweaty in the middle of the night. Even on the lowest setting.
these whales would need extensive rehabilitation, and would have to be introduced to other wild pods in any area where they are released.
it might be very difficult to untrain them from seeking humans and begging for food, or stealing from fishermen at the risk of hooks or nets.
yes thats the problem in this situation. its not cool anymore to keep these [people?] in captivity for a show, such research/rehab facilities are winding down and dissappearing.
Ontario Today on CBC talked to it and the facilities in Iceland found that they didn't do well and never left even when they could. They've never lived out of captivity. I think the Gov should take over care of them and take enough for 20-30yrs of care from the sale of the property.
That has git integration, like bat does? That shows non-printable characters like bat does? That allows you to concatenate and page multiple files at once like bat does? That supports the --line-range option like bat does? You can pipe the output of tail -f through your alias?
I guess if all you did was read the headline of the post you could assume your alias does all the same things as bat.
Not the GP and I do like bat, but to answer your questions:
> That shows non-printable characters like bat does?
cat does actually support that via the flags with -v (you can also use -t and -e to view tab and line endings too)
> That allows you to concatenate and page multiple files at once like bat does?
cat is literally called “cat” because it’s intended purpose is concatenation.
It’s not a pager though the GPs example did pipe to less anyway.
> That supports the --line-range option like bat does?
‘tail’ and ‘head’ would be muscle memory to a lot of people and not that different in terms of number of keystrokes.
But I do take your point that it’s nice to have that built into your pager.
> You can pipe the output of tail -f through your alias?
I couldn’t see why not. tail -f isn’t doing anything weird with the fd.
———
I’m not arguing against using bat though. I have it aliased to cat on my own machines, so I clearly and would recommend bat. But I do think some people might be surprised how far you can get with coreutils if bat wasn’t available
>> That allows you to concatenate and page multiple files at once like bat does?
>cat is literally called “cat” because it’s intended purpose is concatenation.
cat's behaviour and bat's behaviour is different, though.
>cat a.txt b.txt
It was a dark and stormy night.
Once upon a time.
>bat a.txt b.txt
───────┬──────────────────────────────────────────────────────
│ File: a.txt
───────┼──────────────────────────────────────────────────────
1 │ It was a dark and stormy night.
───────┴──────────────────────────────────────────────────────
───────┬──────────────────────────────────────────────────────
│ File: b.txt
───────┼──────────────────────────────────────────────────────
1 │ Once upon a time.
───────┴──────────────────────────────────────────────────────
This difference becomes more useful once we have a more meaningful example:
It's hard to imagine many people have the muscle memory for the combination of cat, head, and whatever else you need to add headers with the filename and file size, call out empty files, highlight the second line, show line numbers, do syntax formatting, and wrap to the terminal width (head doesn't do this).
What you're showing here is not concatenation, there are fancy borders between file chunks and whatnot. Unless you have very different, unconventional definition of concatenation.
In fact, you're at odds with bat's README:
> you can still use bat to concatenate files. Whenever bat detects a non-interactive terminal (i.e. when you pipe into another process or into a file), bat will act as a drop-in replacement for cat
> It's hard to imagine many people have the muscle memory for the combination of cat, head, and whatever else you need to add headers with the filename and file size, call out empty files, highlight the second line, show line numbers, do syntax formatting
Honestly, it's harder to imagine many people with need for most combinations of these features. I can see general audience who would happily use one feature at a time, and if someone is constantly doing obscure one-off file analysis, chances are bat is just never enough, they're going to write long pipelines with awk/perl or use vim macros anyway, so there are no time savings nor convenience from using bat. (Is it really that much more convenient to read syntax-highlighted heads with line numbers? And I can barely remember the last time when `head` that also shows file sizes could've been much more handy than `du * ; head *`.)
Also, good luck using all that bat muscle memory in docker containers or old-school fleet of remote servers.
> and wrap to the terminal width (head doesn't do this)
Terminals already wrap long lines just fine, they don't need help from anything. They can also re-wrap lines when window gets resized.
when i am concatenating multiple files i generally don't need highlighting. that said,
when i am reading multiple files with less, switching back and forth between them is rather cumbersome, and having them concatenated together is actually a benefit, because for example i can search over multiple files at once. so bat is not a better cat, but it's a better less.
looks like you are right, but...
I almost never used all of this features with bat. Maybe tail -f sometimes.
Do you really need this in daily workflow?
I call cat when I need to pipe or copy something, and just bat if I wanna read it myself. I find this as a good compromise, I like how bat formats things.
Your solution would be ok with an alias as well, so thanks. Might try it just so I dont need yet another program lying around
I know. But that doesn't make it accurate. And in broader strokes, I'm not fond of that thread/comment being used to pretend that all new and shiny things are better than what came before. Sometimes the new thing is barely more than a coat of paint on the existing thing.
oh, i feel stupid now, the reason bat worked and highlight didn't was because bat had access to the filename extension. if highlight is called with a filename argument it can detect the syntax too.
so really bat and hightlight are equal, and it's not just a useless use of cat, but using cat here actually breaks the syntax detection. and it does so in bat too, obviously.
so this means highlight almost wins because it has pike support already, whereas for bat i had to add it, except that it turns out that if highlight can't detect the syntax it produces nothing, and you need --force to fix that, and if it is given multiple files as arguments it writes the output to files too, which is practically never what i want so i need to fix that with --stdout.
Although I agree with other commenters that your command can't compare to all of bat's features, many of which I appreciate... thank you for sharing this tip, I didn't know about `highlight` and I can't install `bat` at work.
This will live in my .bashrc for a long time:
cat() {
if [[ -t 1 ]]; then
command cat "$@" | highlight --force -O xterm256
else
# plain cat to pipe into other things
command cat "$@"
fi
}
This... doesn't work? Everything just comes out green. It's not clear to me how 'highlight' could even possibly know what syntax it's supposed to be highlighting when processing stdin, unless it ingests the whole thing until EOF and then applies some kind of fuzzy logic. If you feed it a filename as an argument, it just checks the extension.
Sadly does not work on fish because the developers does not believe that users are intelligent enough to understand the obvious and intuitive outcome of flipping ">" (a valid operator in fish).
reply