mstdn.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A general-purpose Mastodon server with a 500 character limit. All languages are welcome.

Administered by:

Server stats:

16K
active users

#shellscripting

1 post1 participant0 posts today

I figured out how to "stub" specific commands in shell script tests, but it's not pretty.

# stub the "command" command as a function
function command() {
if [[ "$1" == "-v" ]] && [[ "$2" == "java" ]]; then
# stub that java is not installed
return 1
else
/usr/bin/command $*
fi
}

# and to remove the stub
unset command

Je viens d'arriver à écrire un script shell en une ligne de awk pour un projet Kirby bilingue où je dois formater des gros fichiers .txt exportés depuis un tableau de traduction sous forme de tableaux PHP indentés correctement, et ça me rend heureux :

`awk -F$'\t*' '{gsub(/[ \t]+$/,"",$1); print " \""$1 "\" => \"" $2 "\","}' input.txt`

Alors que c’est pas fou hein en soi, mais c’est tellement satisfaisant quand ça marche !

#RaspberryPi owners, how do you back up your #RPi?
I don’t have an extra hard drive, so I need to back up to #GoogleDrive. I’ve installed #Rclone and tried creating a #BASH script, but I’m struggling with it.
If you’ve set up something similar or have recommendations for an efficient backup workflow, I’d love to hear them! Bonus points if you know any good courses or resources to improve my scripting skills.
#Linux #Tech #SelfHosted #SelfHosting #RaspberryPiBackup #RaspberryPi500 #RaspberryPiProjects #RPiBackup #RaspberryPiOS #RPiProjects #LinuxBackup #LinuxTips #LinuxCommunity #TechSupport #OpenSource #DataBackup #CloudBackup #GoogleDriveBackup #CloudStorage #FileBackup #Rclone #BASHScript #ShellScripting #ProgrammingHelp #CodeNewbie #LearnToCode #TechSolutions #Automation #techhacks @linux @selfhost @selfhosting @selfhosted

If anyone following me is learning the terminal (or was even in the class I taught this semester - blog post about that coming soon!), then this post might be of interest to you:

Free ebooks seem to be available for a limited time.

mastodon.social/@itsfoss/11374

MastodonIt's FOSS (@itsfoss@mastodon.social)Free e-books to conveniently learn about the Linux terminal and bash shell scripting! 📖 https://news.itsfoss.com/tuxmas-day-5/