#BASH

2026-02-08

Environment variables set with export in .bashrc persist after deletion #commandline #bash #environmentvariables

askubuntu.com/q/1563741/612

Stefano Marinellistefano@bsd.cafe
2026-02-08

I'm testing the new BSSG test build. I've been working on it for a while to refactor the build process and move it entirely to RAM (optionally, for now).
On my OpenBSD Amsterdam VPS (single core, spinning drives), build times are cut down to less than a third of the last release, and on other devices it takes about half the time, with zero I/O.

The current caching system isn't exactly rock-solid, and personally, I prefer a faster full build over maintaining all that complexity.

I'll probably upload everything as soon as I've ironed out a couple of bugs, in the coming days.

#BSSG #SSG #Bash #StaticSiteGenerator

2026-02-08

Kennt sich hier jemand mit #rclone aus? Ich brauche für ein #bash Script einen automatisierten mount, sodass der Nutzer höchstens das Passwort angeben muss.

Es gibt einen 'one-liner' für die Einrichtung einer rclone config, aber es scheint ein Problem mit dem Passwort zu geben. Ich habe online gelesen, dass rclone keine Klartext-Passwörter (zumindest in der Kommandozeile) akzeptiert, oder diese verwirft. Sobald man über
rclone config das Passwort neu eingibt, funktioniert alles.

Vielleicht gibt es hier jemanden, der schonmal eine rclone config automatisch einrichten lassen konnte.

Gerne Boosten
​:ablobcatheart:​

2026-02-08
no #bash #bashing, but ...

local does restrict variable to function
but if used together with assignment, it is a command too, so it hides exit code...

_________________________________
#!/bin/bash

value=$(false)
returncode=$?
echo "$value $returncode"

test_value() {
value=$(false)
returncode=$?
echo "$value $returncode"
}

test_local_value() {
local value=$(false)
returncode=$?
echo "$value $returncode"
}

test_declare_local__value() {
local value
value=$(false)
returncode=$?
echo "$value $returncode"
}

test_value
set -e
test_local_value
set +e
test_declare_local__value
________

1
1
0
1

_______

yep

never use local var=$(...) if you want get return code or set -e to trigger end

( don't believe i'm good at it, it's been for me 20 years of bash to get there.... )
2026-02-08

YunoHost : un hébergement auto‑géré à la portée de tous

YunoHost est une distribution serveur Debian conçue pour rendre l’auto‑hébergement accessible à tous grâce à une installation en quelques clics et une interface web intuitive. Elle propose un catalogue d’environ 500 applications (Nextcloud, WordPress, Roundcube, etc.), une gestion centralisée des comptes via LDAP et un SSO, ainsi qu’une sécurité intégrée (Let’s Encrypt, pare‑feu nftables, fail2ban). Le système tourne sur une large gamme de matériels, du Raspberry Pi 3 aux serveurs dédiés, et offre des options de sauvegarde et de mise à jour automatisées, faisant de YunoHost une solution simple, riche en fonctionnalités et évolutive pour particuliers, associations et petites entreprises.

project4geeks.org/yunohost-un-

Richard "mtfnpy" Harman (he/him)xabean@infosec.exchange
2026-02-07

I keep forgetting this:

In #bash you can produce arbitrary strings with $'' (that's: dollar, single-quote, single-quote) using the common C style escape sequences like \r\n, \x41, \cg

Used like:

IFS=$'\n'; for foo in `cat list_of_files_with_spaces_one_per_line.txt`; do mv ./$foo ./new/$foo;done

Yes, this is contrived but I can NEVER for the life of me remember that it's dollar-tick-tick.

𝐋🅦🆄𝐢𝖇-ᖆ_🐧lbr59@mastodon.roflcopter.fr
2026-02-07

Ben c'est con en fait une #AppImage c'est pas sensé embarquer toutes les dépendances?

Déjà obligé de la lancer dans le #Terminal pour avoir un peu de verbosité pour savoir pourquoi il ne se passe rien quand je l’exécute depuis son icône.

#Linux #Debian #Application #Terminal #Bash #Bug

Une capture d'écran d'un terminal Linux noir,  affiche des lignes de texte blanches de messages d'erreurs au lancement d'un fichier, indiquant que des dépendances ne sont pas satisfaites.
2026-02-07

@claudius me too. I wonder if there is a #bash security analyzer that would look for common issues in scripts that people could put in the middle. Like pv, but a condom.

Whenever *I* see that, I save the script and at least give it a glance. But most people don't know bash as well as I do.

But if it could be normalized for such instructions to include that check, the source would check that their script won't trigger warnings, and the end user could have more confidence.

Para los que uséis CDMon para vuestro dominio, he creado un pequeño script en Bash para actualizar vuestra IP dinámica si alojáis desde vuestro servidor en casa.

Existen otros scripts creados por terceros en Python o Perl, pero hay que instalar los paquetes de los lenguajes para usarlo, y si no los necesitas, no merece la pena.

Lo tenéis en Codeberg para uso libre:
https://codeberg.org/gide0n/CDMon_Updater/src/branch/main/cdmon_updater.sh

Después lo agregáis en vuestro crontab de esta manera para que lo revise cada 15 minutos y listo:

## UPDATE CDMON
*/15
/user/scripts/cdmon-updater.sh

¡Espero os sirva!
#codeberg #script #bash #linux #debian #programacion #IP #dynamic

2026-02-07

Mon nouveau moyen préféré pour comparer les propriétés d'un fichier original invalide et celles du fichier dont j'ai corrigé la structure :

vimdiff <(exiftool original.tif | sort) <(exiftool transforme.tif | sort)

#DigiPres_FR #Bash

Mauricio Teixeira🐧:kubernetes:badnetmask@hachyderm.io
2026-02-07

I have some parameters for some Linux commands which are burned in my brain, and work for 95% of my needs:

* tar czvpf (also x)
* rsync -PSavv
* netstat -lntp (also works for ss)

I got used to those way back when during my Service Desk times, and now they're just muscle memory.

Oh. And the one more "modern" is:

* kubectl get events -Aw (btw: "alias k=kubectl")

That's my Kubernetes variation of "journalctl -f" (also previously known as "tail -f /var/log/messages").

How about you? What are yours? 😄

#HomeLab #Bash #Linux #Kubernetes @homelab

2026-02-06

Corso Rust&Linux - 30: La variabile d'ambiente PATH

video.linux.it/videos/watch/d0

2026-02-06

Seeing all these videos recently about the Epstein files having the Bash manual in them, I thought it would be a good time to make another new blog post about Bash and some useful built-in functionality that I have come to use and love.

$FUNCNAME

Read about it here; meatlotion.com/blog/bash_has_a

#bash #$FUNCNAME #blog

MSvanamsvana
2026-02-06

I was today years old when I discovered the greatness of the `xargs` command on Linux.

2026-02-06

#shell #bash #SillyScripts

#!/bin/sh

# Do not manually set the next line, use `blister reset N`
start="20483"
blister=' ╭───┬───┬───┬───┬───╮
│ 1 │ 3 │ 5 │ 7 │ 9 │
├───┼───┼───┼───┼───┤
│ 0 │ 2 │ 4 │ 6 │ 8 │
╰───┴───┴───┴───┴───╯'

maxPills=10

reset(){
current="$1"
today=$(($(date -d 00:00 +%s) / (60 * 60 * 24)))
start=$((today - maxPills + current))
sed -i 's|^start=".*"$|start="'"$start"'"|' "$0"
}

isInt(){
if echo "$1" | grep -q -e "^[0-9][0-9]*$" ; then
return 0
else
return 1
fi
}

help(){
prog="$(basename "$0")"
cat << EOF
'$prog' shows how many pills I should have on the blister($maxPills pills) by the end of the day.

USAGE: $prog [OPTIONS]

Options:
--help, -h Shows this help and exits.
'reset \$N' Reset the number of pills on the blister. '\$N' should be how many pill you will have by the end of the day. You will only need to reset if you skipped a day.
EOF
}

showpills(){
today=$(($(date -d 00:00 +%s) / (60 * 60 * 24)))
pills=$((maxPills - ((today - start) % maxPills)))
echo "I should have $pills pills."
remove=$(((maxPills - 1) - pills))
if [ "$remove" -gt 0 ]; then
echo "$blister" |
sed 's|[0-'"$remove"']|◌|g;s|[0-9]|●|g'
else
echo "$blister" |
sed 's|[0-9]|●|g'
fi
}

if [ "0" != "$#" ]; then
case "$1" in
"reset")
if ! isInt "$2"; then
help 1>&2
exit 1
fi
reset "$2"
exit 0;
;;
"--help"|"-h")
help
exit 0
;;
*)
help 1>&2
exit 1
;;
esac
fi

showpills

2026-02-06

#shell #bash #SillyScripts

Hi! Today I want to (re)share with you a silly but useful script I made: blister. It helps me to keep track of how many pill I should have after I take my daily pill:

(^_^)~(12:50|0|ruri)~>
~> blister
I should have 3 pills.
╭───┬───┬───┬───┬───╮
│ ◌ │ ◌ │ ◌ │ ● │ ● │
├───┼───┼───┼───┼───┤
│ ◌ │ ◌ │ ◌ │ ◌ │ ● │
╰───┴───┴───┴───┴───╯

The scripts keeps track of when did I star taking the pills, and assumes that I do not skip any. If I do, it does have a function to reset itself.

I'll show you the code on the next post.

2026-02-06

Wie schafft man es, die Vorteile von CRF zu nutzen und dabei die gewünschte durchschnittliche Bitrate beizubehalten?
--> Man lässt den passenden CRF Wert automatisch durch mehrere kleine Versuche ermitteln
​:blobcatuwu:​

Jup, Lorker skriptet wieder Zeug.

#Bash #ffmpeg

xennialXennial_
2026-02-06

i dont know who needs to hear this... but this saved my day

`find . -mindepth 2 -type f -exec mv -n -t . {} + && find . -mindepth 1 -type d -empty -delete`

just flattens a folder, takes alllllll the sub folders and their sub folders and flattens them into the current dir.

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst