I've probably tooted about this before, but I don't know why this isn't standard.
It's just so obvious, at least to me. ;)
~ $ type mcd
mcd is a function
mcd ()
{
[[ -n $1 ]] && mkdir "$1" && cd "$1"
}
I've probably tooted about this before, but I don't know why this isn't standard.
It's just so obvious, at least to me. ;)
~ $ type mcd
mcd is a function
mcd ()
{
[[ -n $1 ]] && mkdir "$1" && cd "$1"
}
Should've made this a long time ago:
function ciglob {
#case-insensitive glob generator
echo "$*" |while read -N1 c; do
case "$c" in
[a-zA-Z]) echo -n "[${c^^}${c,,}]";;
*) echo -n "$c"
esac
done
}
~ $ ciglob "Hello, world!"
[Hh][Ee][Ll][Ll][Oo], [Ww][Oo][Rr][Ll][Dd]!
~ $ ls -ld $(ciglob documents)
drwxr-xr-x 52 ~~~ ~~~ 20,480 Apr 10 11:45 Documents
(Not the most useful example, but I did have a use case in mind when I wrote it ;)
P.S. (This is a valid way to close a parenthesis. Fight me ;)
Curious how coding can support your research?
Join our Software Carpentry Workshop for absolute beginners – no experience needed, just curiosity and motivation!
May 12–13, 2025, 09:00–16:00
ZB MED, Cologne
Hands-on sessions on:
#UnixShell
#Git for version control
#Python programming
With @RabeaMue, Silvia Di Giorgio & Justine Vandendorpe
Register: https://zbmed.github.io/2025-05-12-Software_Carpentry_ZB_MED/
@Silversnapples @philheppenstall @Swebb63
I understand what Phil was saying, and this is exactly why I have the @JdeBP account.
For the benefit of MastodonApp.UK I can offer this translation from the jargon of Hippie-Unix:
Phil was clearly stoned in the 1990s.
'Peace and Love and vi key bindings, baby! "set -o emacs" is just what The Man wants you to type, man!"
(-: