Make: don't print command-line with @
TIL: in a Makefile command, use @ as a prefix to avoid printing the command line as it is executed
TIL: in a Makefile command, use @ as a prefix to avoid printing the command line as it is executed
TIL: use the flag -L to read the manpages with a different locale: man -L en_us nmap Alternative: set the LC_ALL env variable as part of the command https://unix.stackexchange.com/a/87763/79225 # LC_ALL is the environment variable that overrides all the other localisation settings # The C locale is a special locale that is meant to be the simplest locale. LC_ALL=C man 2 select
TIL: use realpath to print the absolute path of a file. Useful for creating symlinks. for f in $(realpath scripts/linux/*); do ln -s "$f" ~/bin/$(basename "$f"); done
TIL: use whitespace-mode from emacs to check trailing whitespace in files. Useful in some situations, i.e. in shell scripts to guarantee that line continuation (backslash) don’t have trailing whitespace, which is a problem.
Used shellcheck, a shell linter, very useful.
TIL: pipe output of commands that are tabular to the column command to make them more readable
TIL: use the readlink command to resolve symbolic links to executables. Use the -f option to follow the link recursively. # find the path to the youtube-dl script. readlink -f $(which yt-dlp)
The Google Sheet function ISBLANK() goes against all that is right and holy, and evaluates the empty string as non-blank.
https://stackoverflow.com/questions/3224878/what-is-the-purpose-of-the-colon-gnu-bash-builtin https://unix.stackexchange.com/questions/31673/what-purpose-does-the-colon-builtin-serve Historically, Bourne shells didn’t have true or false as built-i commands. true was simply aliased to : : is slightly better than true for portability. Uses: # alias to true while : ; do command ; done # variable expansion, assign default value var= : ${var:=DEFAULT} echo $var DEFAULT
TIL: purge is identical to remove, but it also deletes configuration files