add: friendly path-export & open startfiles for bash

master
zeus 2023-05-25 14:28:43 +02:00
parent 1dc5b0b858
commit 5afbb937cf
2 changed files with 11 additions and 0 deletions

5
bash/bash-open-startfiles.sh Executable file
View File

@ -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'

6
bash/friendly_path-export.sh Executable file
View File

@ -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"