mastodon.world is one of the many independent Mastodon servers you can use to participate in the fediverse.
Generic Mastodon server for anyone to use.

Server stats:

8.1K
active users

#shell

19 posts19 participants1 post today

Readline has a lot of useful command history functions that largely obviate the need for traditional history expansion in Bash.

Some features remain useful like quick substitution (^ ^) and the current line event designator (!#). In many cases they can be faster than command line editing or cut-and-paste.

Another useful tool is fc (originally ksh). While opening an editor with commands is a surprising approach, it can edit and run a range of history lines at once!

#Atuin is working great for me (especially with a few configuration tweaks) everywhere and in every #Shell except in complex commands (i.e., commands with pipes and or sub-shells) in Git Bash for Windows #GitBashForWindows. My problem here probably has something to do with the Bash preexec hook or whatever it's called; and it might be fixable.

Here are my tweaks:

```toml
store_failed = true
invert = true # I think this value is a change from the default
search_mode_shell_up_key_binding = "prefix"
```

The Shell Scripting Tutorial: Parsing long command-line arguments with getopt

programming.dev/post/34357159

programming.devThe Shell Scripting Tutorial: Parsing long command-line arguments with getopt - programming.devThis is a little tutorial that I found in my search to learn how to use getopt (mind: not getopts, which is a completely different thing). I want to share it here because I find it refreshingly to the point. Just the main code block already tells almost the whole story: #!/bin/bash # Set some default values: ALPHA=unset BETA=unset CHARLIE=unset DELTA=unset usage() { echo "Usage: alphabet [ -a | --alpha ] [ -b | --beta ] [ -c | --charlie CHARLIE ] [ -d | --delta DELTA ] filename(s)" exit 2 } PARSED_ARGUMENTS=$(getopt -a -n alphabet -o abc:d: --long alpha,bravo,charlie:,delta: -- "$@") VALID_ARGUMENTS=$? if [ "$VALID_ARGUMENTS" != "0" ]; then usage fi echo "PARSED_ARGUMENTS is $PARSED_ARGUMENTS" eval set -- "$PARSED_ARGUMENTS" while : do case "$1" in -a | --alpha) ALPHA=1 ; shift ;; -b | --beta) BETA=1 ; shift ;; -c | --charlie) CHARLIE="$2" ; shift 2 ;; -d | --delta) DELTA="$2" ; shift 2 ;; # -- means the end of the arguments; drop this, and break out of the while loop --) shift; break ;; # If invalid options were passed, then getopt should have reported an error, # which we checked as VALID_ARGUMENTS when getopt was called... *) echo "Unexpected option: $1 - this should not happen." usage ;; esac done echo "ALPHA : $ALPHA" echo "BETA : $BETA " echo "CHARLIE : $CHARLIE" echo "DELTA : $DELTA" echo "Parameters remaining are: $@" Just be sure to correct the inadvertent mixing of beta and bravo.

Climat #entreprise

#Shell quitte le groupe climatique suite à sa proposition d'arrêter le développement des champs pétroliers et gaziers

Shell a quitté un groupe consultatif chargé d'élaborer une stratégie visant à rendre les sociétés pétrolières et gazières climatiquement neutres d'ici 2050. L'une des propositions visant à atteindre cet objectif va trop loin pour la société énergétique.