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:

17K
active users

#Bash

47 posts38 participants4 posts today

Every so often I find a new feature of #fish that reminds me why I prefer it over #bash or #zsh.

Today I was reminded to replace most of my aliases with fish abbreviations.

Granted, I already knew about abbreviations, but somehow never really used them extensively.

Keeping track of an old slow spinning disk rsync transfer realistically like: while true; do OLD_USED=$(df /mnt/mumlappy | awk '{if (NR==2) print $3}');NEW_USED=$(df /mnt/newlappy | awk '{if (NR==2) print $3}');echo $(((NEW_USED*100)/OLD_USED))%; sleep 60; clear; done
#linux
#rsync
#bash

I have a #Bash alias (actually a function) for `git clone` that sets my #git config username and email address based on a prompt (I can select between various accounts/SSH keys I have).

I now want to do a similar thing for `git init`. Is there an easy way to call the same bash code for the prompt and setting git config values without duplicating it all between my two functions?

AFAIK bash functions cannot return values (e.g. my chosen username/email)...