From afe6861bdfe7e386d3bdf3e94a1891eb5d70c0f8 Mon Sep 17 00:00:00 2001 From: q Date: Mon, 11 May 2015 20:17:08 +0300 Subject: [PATCH] single script to enable --- README | 5 ++++- rc | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 rc diff --git a/README b/README index 8d5ba67..ce81039 100755 --- a/README +++ b/README @@ -6,8 +6,11 @@ cd $( dirname $0 )/bin -( +( +echo Add the tools to PATH by sourcing the "rc" in this folder + for e in *; do + test -x $e || continue echo -e "\n===== $e =====\n" ./$e -h done diff --git a/rc b/rc new file mode 100644 index 0000000..a4d0cf9 --- /dev/null +++ b/rc @@ -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 +