𝘋𝘪𝘳𝘬

Somewhere between Linux woes, gaming, open source, 3D printing, recreational coding, and occasional ranting.

🔗 Me, but elsewhere

🇬🇧 / 🇩🇪

  • 0 Posts
  • 37 Comments
Joined 1 year ago
cake
Cake day: June 9th, 2023

help-circle
  • It first checks if ~/.bashrc.d is an existing directory. If this it the case it then iterates over all entries in that directory. In this iteration it checks if the entry is a file and if this is the case it sources that file using the bash-internal shorthand . for source.

    So it basically executes all scripts in ~/.bashrc.d. This makes it possible for you to split your bash configuration into multiple files. This quite common and a lot of programs already support it (100% depends on the program, though).

    This is absolutely harmless as it is. But: if you or a program places anything in the directory ~/.bashrc.d it WILL be sourced everytime you start a bash.

    A slightly better variant would be iterating over ~/.bashrc.d/*.sh instead of just ~/.bashrc.d/* to make sure to only grab files with the .sh suffix (even if suffixes are basically meaningless from a technical point of view) and also test for the file being executable (-x instead of -f).

    This would make sure that only files that are ending with .sh and that are executable are sourced. The “attack vector”, if you want to call it like that, would then be a bit more narrow than just placing a file in a directory.

    As for why it’s there: Did you ever touch your .bashrc? If not, maybe it is there since the beginning because it’s in the so-called skeleton (see /etc/skel/.bashrc) that was used to initialize certain files on user account creation.




















  • I have to use Windows on my work computer and I am finding it hard to get FOSS applications on Windows that can do stuff like

    The Gold standard in the screen recording world is OBS. It’s not only available for Linux, but also for Windows and, well, is the gold standard. If you ask the question if OBS can do this-or-that regarding screen recording, the answer generally is yes (or “yes, via plugin”). Just use OBS on all platforms, it’s clearly the most mature screen recording tool out there.