#BashAlias

Neil :emacs: :orgmode:nshephard@fosstodon.org
2025-03-11

Useful alias I use all the time...

```
export ymd='date +%Y%m%d'
```

I can then use it when I want to create directories/files that are date stamped...

```
mkdir something-$(ymd)
```

#bash #alias #BashAlias

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)...

#BashAlias #Linux #coding #programming

Client Info

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