single script to enable

This commit is contained in:
q
2015-05-11 20:17:08 +03:00
parent e63ada72cf
commit afe6861bdf
2 changed files with 16 additions and 1 deletions

5
README
View File

@@ -6,8 +6,11 @@
cd $( dirname $0 )/bin cd $( dirname $0 )/bin
( (
echo Add the tools to PATH by sourcing the "rc" in this folder
for e in *; do for e in *; do
test -x $e || continue
echo -e "\n===== $e =====\n" echo -e "\n===== $e =====\n"
./$e -h ./$e -h
done done

12
rc Normal file
View File

@@ -0,0 +1,12 @@
# source me to enable tools
TOOLSPATH=$( readlink -f $( dirname "$BASH_SOURCE" ) )
PATH=$PATH:"$TOOLSPATH"/bin
# remove duplicate path
PATH=$( echo $PATH | awk -F: '{for (i=1;i<=NF;i++) { if ( !x[$i]++ ) printf("%s:",$i); }}' | sed 's,:\+$,,g' )
export PATH
. "$TOOLSPATH"/qcd_function