================== Executable Aliases ================== .. default-domain:: bash .. file:: aliases.bsh Because bash scripts do not use ``alias`` by default, common external programs are soft-coded using an all-caps variable name (e.g. ``tar`` is called using ``"${TAR}"``. Simply source :file:`aliases.bsh` and use the variables. For example, instead of hard-coding "tar" everywhere, use the variable ``TAR`` so that when the need comes, it is easier to switch which executable gets called. When an alias variable is used, this variable should be surrounded by quotes, e.g. ``"${TAR}"``. Variables should default to the common executable name, and allow the user to override them. For example, :var:`SSH` defaults to ``ssh``. There are a number of ways to override this: * ``SSH=ssh2`` - Finds the command on the path called ``ssh2`` * ``SSH=/usr/local/bin/ssh`` - Uses a full path * ``function ssh3(){ SSH_FLAG=3 ssh -v ${@+"${@}"}; }; export -f ssh3; SSH=ssh3`` - Use an exported function * ``echo '#!/usr/bin/env bash' > ~/foo; echo 'ssh -v ${@}' >> ~/foo; chmod 755 ~/foo; SSH=~/foo`` .. note:: ``SSH="ssh -v"`` will look for an executable called ``ssh -v``, instead of running ``ssh`` with the ``-v`` flag, as desired. .. var:: GIT Name/path of git executable :Default: ``git`` .. var:: TAR Name/path of tar executable :Default: ``tar`` .. var:: DOCKER Name/path of docker executable :Default: ``docker`` .. var:: DOCKER_COMPOSE Name/path of docker compose command :Default: ``docker compose`` (note, this is a bash array by default) .. var:: SINGULARITY Name/path of singularity executable :Default: ``singularity`` .. var:: NVIDIA_SMI Name/path of nvidia-smi executable :Default: ``nvidia-smi`` .. var:: NVCC Name/path of nvcc executable :Default: ``nvcc`` .. var:: SSH Name/path of ssh executable :Default: ``ssh`` .. var:: GPG Name/path of gpg executable :Default: Favors ``gpg2`` if it's installed, else ``gpg``