diff --git a/bash/bash-open-startfiles.sh b/bash/bash-open-startfiles.sh new file mode 100755 index 0000000..609f436 --- /dev/null +++ b/bash/bash-open-startfiles.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# lists all files, an interactive login-shell with bash would try to open. Useful to find the correct order of .bashrc .profile and such. + +echo exit | strace bash -li |& grep '^open' diff --git a/bash/friendly_path-export.sh b/bash/friendly_path-export.sh new file mode 100755 index 0000000..5fcd524 --- /dev/null +++ b/bash/friendly_path-export.sh @@ -0,0 +1,6 @@ +#/!bin/bash + +# exports a path only, if $PATH does not already contains the path. + +NEWPATH="$1" +echo ":$PATH:" | grep -q ":$NEWPATH:" || export PATH="$PATH:$NEWPATH"