read .profile, not .profile.d
This commit is contained in:
1 parent
407425ca78
commit
8335a2b1ba
1 file changed
+6
-9
+6
-9
@@ -16,12 +16,12 @@ usage() {
|
|||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
read_profiled=""
|
read_profile=""
|
||||||
|
|
||||||
while getopts ":hd:p" OPT; do
|
while getopts ":hd:p" OPT; do
|
||||||
case $OPT in
|
case $OPT in
|
||||||
d) cd "$OPTARG" ;;
|
d) cd "$OPTARG" ;;
|
||||||
p) read_profiled="1" ;;
|
p) read_profile="1" ;;
|
||||||
h) usage ;;
|
h) usage ;;
|
||||||
\?) error "invalid option: -$OPTARG" ;;
|
\?) error "invalid option: -$OPTARG" ;;
|
||||||
:) error "option -$OPTARG requires an argument" ;;
|
:) error "option -$OPTARG requires an argument" ;;
|
||||||
@@ -32,13 +32,10 @@ shift $((OPTIND-1))
|
|||||||
|
|
||||||
[ -z "$1" ] && usage
|
[ -z "$1" ] && usage
|
||||||
|
|
||||||
if [ "$read_profiled" == "1" ]; then
|
if [ "$read_profile" == "1" ]; then
|
||||||
shopt -s nullglob
|
if [ -f .profile ]; then
|
||||||
for script in .profile.d/*; do
|
source .profile
|
||||||
echo "sourcing $script"
|
fi
|
||||||
source $script
|
|
||||||
done
|
|
||||||
shopt -u nullglob
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
Reference in new issue
Block a user