
Classically, because the terminal is a grid of equally sized characters, only a single text size was supported in terminals, with one minor exception, some characters were allowed to be rendered in...

Keep posts about shell scripting! Here are some guidelines to help:
Kitty Terminal 0.40.0 introduces the Text Sizing Protocol: "multiple font sizes ... in a backwards compatible, opt-in way"
Classically, because the terminal is a grid of equally sized characters, only a single text size was supported in terminals, with one minor exception, some characters were allowed to be rendered in...
Using sed to match regexp patterns in a file with a fixed string (not the other way around)
Hi there!
Usually, sed can be used in different ways, but most of the time we use it to match lines in a file against a fixed regexp. Some examples:
This replaces ocurrences of regexp for "foo":
undefined
sed 's/regexp/foo/g' < myfile
This prints all lines that have "foo", but will change the first "o" in the line for an "a":
undefined
sed -n '/foo/s/o/a/p' < myfile
and so on...
But I tried to do a different thing, with no success: can I pass to sed a file with a bunch of regular expressions and test them against a fixed string? I tried to play with pattern space, hold space, with no success. It just seems impossible to use them (which would be the closest to "variables") in search commands.
I know sed is Turing complete, but using it that way would maybe require to implement a regexp engine from scratch?
Thanks!
Productivity vs muscle memory/knowledge
After a long time I'm in a situation where I sometimes work on a temporary system without my individual setup. Now whenever I might add a new custom (nushell) command that abstracts the usage of CLI tools, I think about the loss of muscle memory/knowledge for these tools and how much time I waste looking them up without my individual setup. No, that's not a huge amount of time, but just out of curiosity I'd like to know how I can minimize this problem as much as possible.
Do you have some tips and solutions to handle this dilemma? I try to shadow and wrap existing commands, whenever it's possible, but that's often not the case. Abbreviations in fish are optimal for this problem in some cases, but I don't think going back to fish as my main shell for this single reason would be worth it.
A few shell documentation gems
I'm hosting mirrors of these at my domain.
Help creating custom fuzzy seach command script.
I want to interactively query nix pkgs using the nix-search command provided by nix-search-cli
Not really experiaenced in cli tools any ideas to make this work ?
New 2024 POSIX Standards specify features for sh and standard shell utilities
The document itself is paywalled like all the POSIX specifications, so here are some highlights courtesy of some comments at HackerNews, especially from a-french-anon.
Configure your new computer or server with a convenience POSIX shell script, instead of doing it all manually
Utilise POSIX Shell to take the hassle out of configuring your system each time you get a new computer or provision a server.
CLI bookmarking utility
a cli utility for bookmarking directories. Contribute to danhab99/cli-bookmarks development by creating an account on GitHub.
Is there a better algorithm for converting big binaries into decimal?
At the moment, I am stuck with using single-precision float, and double-precision float. So, the maximum represent-able value for single is 1<<24 while for double, it is 1<<53.
Because of this, I made the following script here - https://gist.github.com/Reptorian1125/71e3eec41e44e2e3d896a10f2a51448e .
Allow me to clarify on the script above. On the first part, rep_bin2dec does is to return the converted values into the status. So, when I do ${} or variable=${rep_bin2dec\ ???}, I get the status string.
On the second part, rep_bin2dec_base is the basis for getting rep_bin2dec to work. _rep_bin2dec_base prints the base_10M array into a string.
So, how does rep_bin2dec_base converts a big binary into big decimal?
Ksh Python Transpiler
ksh python transpiler. Contribute to dislux-hapfyl/pynksh development by creating an account on GitHub.
Script to automatically update hosts file from a filter list - README.md
Pulling variables from functions executed as conditions
I've written small bash scripts before, but I bit off a little more this time, and I'm trying to program a little terminal game.
Anyway, I've run into a weird behavior. I have a function that, among other things, writes values to an array and returns either 0 or 1.
If I write echo "${name_of_array[@]}"
inside the function, I see the contents of the array printed to standard output.
If I write echo "${name_of_array[@]}"
outside the function immediately after executing the function, I see the contents of the array printed to standard output. (So, clearly the array is being treated as a global variable.)
But if I write the following, regardless of which value the function returns, nothing is printed to standard output but an empty line.
undefined
if ! name_of_function ; then echo "${name_of_array[@]}" fi
Why is that the case? Doesn't name_of_function get executed when evaluating the if statement? Is this some special case where all variables become local?
I realize I could just
Broot is a great file manager TUI which can be adapted for very specific workflows.
Hello! I love broot. It's not my own project, but this blog post is, so feel free to send any questions or insults my way.
Previews:
Looks like v0.90 was skipped on nushell blog, so expect minor changes from these release notes
Release fish 3.7.0 (released January 1, 2024)
This release of fish includes a number of improvements over fish 3.6.4, detailed below. Although work continues on the porting of fish internals to the Rust programming language, that work is not i...
This release of fish includes a number of improvements over fish 3.6.4, detailed below. Although work continues on the porting of fish internals to the Rust programming language, that work is not included in this release. fish 3.7.0 and any future releases in the 3.7 series remain C++ programs.
git log 3.6.1..Integration_3.7.0
by searching for gitInt. ↑
and then later decide to switch to the full pager.