Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Define wrapper functions with absolute paths.
- ##
- ## Example:
- ## - On SunOS use ggrep from /usr/sfw/bin as grep.
- ## use SunOS /usr/sfw/bin ggrep=grep
- use ()
- {
- local sys=$1; shift
- local path=$1; shift
- local def
- local file
- local func
- if [ "$(uname -s)" = "$sys" ]; then
- for def; do
- IFS== read -r file func <<<"$def"
- path=$path/$file
- if [ -x $path ]; then
- eval "${func:-$file} () { $path \"\$@\"; }"
- else
- echo "$0: ERROR: Missing: $path" >&2
- fi
- done
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement