Added scripts to modify PATH. Useful for testing the scripts without copying them anywhere.
This commit is contained in:
parent
780bed4541
commit
ee68a72f60
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
while [ "$1" != "" ] ; do
|
||||
if [ -d "$1" ] ; then echo $(cd "$1" ; pwd) ; fi
|
||||
shift 1
|
||||
done
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
absolutedir () {
|
||||
while [ "$1" != "" ] ; do
|
||||
if [ -d "$1" ] ; then echo $(cd "$1" ; pwd) ; fi
|
||||
shift 1
|
||||
done
|
||||
}
|
||||
|
||||
if [ -d "$1" ] ; then
|
||||
DIR="$1"
|
||||
else
|
||||
DIR="$(pwd)"
|
||||
fi
|
||||
export ALT_PATH="${PATH}"
|
||||
for directory in $(ls --file-type "$DIR" | grep '/' | sed 's/\///') ; do
|
||||
export PATH="${PATH}:$(absolutedir $DIR/$directory)"
|
||||
done
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
if [ "$ORIG_PATH" != "" ] ; then
|
||||
ALT_PATH_LOCAL="${ORIG_PATH}"
|
||||
export ALT_PATH="${PATH}"
|
||||
export PATH="${ORIG_PATH_LOCAL}"
|
||||
else
|
||||
echo "No original path to toggle." >&2
|
||||
fi
|
Loading…
Reference in New Issue