#TIL In bash you can create multiple (nested) directories with a single compact line:
-
@cark neat, isn't it?
-
@cark Loved your piece on `git fire`. It has inspired me.
-
@cark btw it's called brace expansion. I highly recommend reading the man page of bash, it's all in there! It's loong though.
-
@cark Loved your piece on `git fire`. It has inspired me.
@daesorin Thank you
Once in a while I have some random insights that I deem worth sharing. However, while I write up those thoughts I usually doubt whether it is worth the effort...
Therefore, it is really nice to hear that one of those thoughts inspired you that much that you still remember it (and its provenience).
For other readers: This is the post about the proper usage of
in case of 
-
@cark modifiziert -p is idempotent, too!
Like in any Script:tempdir_for_script=“/tmp/tempdir_for_$(basename “$0”)
Later in the script:
<result to log> >> “$tempdir_for_script”Last line of script:
# rm -r “$tempdir_for_script”(Remove # after full debugging)
-
@cark tested on OpenIndiana. Works in the same way. Thx!
-
@cark tested on OpenIndiana. Works in the same way. Thx!
@cark and also with fish on cachyos linux.
-
@cark Man, curly braces in bash creep me out. I can never remember whether that you need a comma to separate items (because glob expansion produces spaces). If I tried to build that command I would get errors or subfolders called ;

-
@cark Shell expansion magic
-
@cark This is a very neat trick of the sort where you learn about it and then spend five minutes thinking of a scenario where it would be useful.

-
@cark Whaaaat?! 🤯
-
R relay@relay.infosec.exchange shared this topic
-
@cark Brilliant, thanks for sharing!
-
@cark I love brace expressions to create backup copies or rename files. E.g. cp a{,.bak} or me b{,.old}
-
@cark I love brace expressions to create backup copies or rename files. E.g. cp a{,.bak} or me b{,.old}
I was not aware of this technique until recently... and yes I see also there are more use cases e.g. with `cp` and `mv`.

-
R relay@relay.infosec.exchange shared this topic