Oh wow, TIL: When you do input redirection from a file in #bash, e.g.
python whatever.py < foo.csv
the running command can actually stat() the stdin file descriptor and get the size of the input file! I would’ve expected that it’s more like “well, it’s your stdin, you can’t get the size for that, it’s a stream”.
And, to be fair, if you don’t directly associate the file to the command, it breaks. For example,
Sometimes I wonder if I should try a different #shell. The thing is if I have to hang on to #bash for compatibility reasons do I really want to have something else also? It's like buying a second hammer just because it's fancier than the regular one you have. Maybe if I was a carpenter, I'd do it. But if I just hammer a nail every once in a while, do I really need the fancy hammer?
A massive fire at a #Houston-area #Shell refinery was just the latest incident at the site, which has generated 1000s of pounds in illegal #pollution ... but $0 in fines from the state.
“source” is a #bashism. The actual #POSIX name of the command is “.”. That’s right, a single dot.
Many people expect . to be some kind of a shortcut for “source”, and yes, they’re equivalent in #bash, but “source” is not guaranteed to exist in other shells. dash doesn’t have it, for example.
So, if you want to write your shell scripts as compatible as possible, use “.”, not “source”.
‘Green colonialism’: Indigenous world leaders warn over west’s climate strategy
"World Indigenous leaders meeting this week at an annual #UN summit have warned that the west’s climate strategy risks the exploitation of #Indigenous territories, resources and people.
New and emerging threats about the transition to a greener economy, including mineral mining, were at the forefront of debate as hundreds of Indigenous chiefs, presidents, chairmen and delegates gathered at the 22nd United Nations Permanent Forum on Indigenous Issues."
#MastodonHelp
Is there any tool to download public posts and retoots and reply toots of an inactive Mastodon account? I forgot to backup my posts before migrating, and I don't know a method that doesn't involve disabling inactivity on the account (and not sure what that will do).
This is hilarious. A #Google engineer invented #zx to make command line scripting easier with #NodeJS, because at a certain point #shell scripts get too complicated and you need a Real #Programming Language.
This is exactly #Perl’s use case from thirty-six years ago. But the kids want #JavaScript everywhere and would rather it take more work to convert their ascended #Bash scripts to a vastly different syntax.
@grin@sullybiker The main problem with #shell scripts is that they’re glue for other commands that may or may not be installed and may or may not be the same as those used by the author.
It’s why #dehydrated has so much logic detecting the installed flavor of awk, sed, grep, diff, et al. “Portable” shell is like portable #C—riddled with brittle environmental tests (thus begetting things like #GNU#Autotools).
Your reply is to a post where I specifically said the point was about converting from #Bash.
If you don’t know how to read a #shell script you definitely don’t know how to convert it to another #programming language. You’ll be doubly handicapped if the new language is nothing like the old.