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.
Is my version of #bash too old, or is bash simply not clever enough to know that if I do alias g='git', that g should now have the same tab-completions as git does?
I'm trying to write a #bash script/function to convert qwerty-typed text into #colemak so I can play with it without actually converting.
It's working great, but won't pass newlines no matter what I try.
Any ideas?
Ze function:
function colemak-practice() {
while IFS= read -sn1 letter
do
echo -n "$letter" |tr "eErRtTyYuUiIoOpPaAsSdDfFgGhHjJkKlL;:nN" "fFpPgGjJlLuUyY;:aArRsStTdDhHnNeEiIoOkK"
done
}
Bon, après des essais de config pour Neovim via Flathub, j'ai dû casser un truc et je m'arrache les cheveux : en console, je ne peux même plus éditer un fichier avec « vim monfichier.txt» (oui, j'ai tjrs Vim), mais ça passe avec «sudo vim monfichier.txt» 😲
Je n'ai aucune idée comment rétablir tout ça et j'y ai passé 1 soirée… (no comment…).
Si quelqu'un peut me conseiller, ce serait formidable.
The only time I reach for #bash scripts these days is when I need to call a few external commands in sequence, often with a few pipes in between them. IMHO there aren’t really that many other use cases left where some more competent scripting language isn’t a better choice. OTOH, why is that (evidently very common) use case still such a chore to do in basically any other language?
Finally got my kitty terminal emulator on #Ubuntu to take CJK input via the ibus IM. It took me an embarrassingly long time because I didn't fully understand the difference between .bashrc and .bash_profile, or that .profile exists.
I thought I had to set export GLFW_IM_MODULE=ibus in my .bashrc, but what I did not realise is that those variables only get read after the teminal emulator is launched. Once I put that envvar in .profile it worked! #BASH
if [ "$DISK_GB_LEFT" -lt "$DISK_GB_LIMIT" ]; then
echo "Less than ${DISK_GB_LIMIT} GB left! Only ${DISK_GB_LEFT} GB left!"
else
echo "There is still ${DISK_GB_LEFT} of ${DISK_TOTAL_GB} GB left. No need to be alarmed as the alarming size is ${DISK_GB_LIMIT} GB."
Uhh.. when I have a function in Bash (let's call it fun() because it isn't), and call it like
$ fun > /dev/null
then - as expected - global variables modified in it are changed in the outer scope afterwards.
If I call it like
$ fun | tee /dev/null
they global variable with its current value is available in the function, but after the call it has the old value from before the call?!
If all goes well with my #VoidLinux#ZFSBootMenu install tomorrow I might be tempted to give #Zsh a try instead of my usual trusty #Bash ?
Anyone want to chime in with reasons for and against zsh ?
SHARE WITH THE CLASS: What aliases are you using?
From bash to zsh and everywhere in between, show me yours and I'll show you mines. Inspire others or get some feedback....