Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. ## Define wrapper functions with absolute paths.
  2. ##
  3. ## Example:
  4. ## - On SunOS use ggrep from /usr/sfw/bin as grep.
  5. ## use SunOS /usr/sfw/bin ggrep=grep
  6.  
  7. use ()
  8. {
  9. local sys=$1; shift
  10. local path=$1; shift
  11. local def
  12. local file
  13. local func
  14. if [ "$(uname -s)" = "$sys" ]; then
  15. for def; do
  16. IFS== read -r file func <<<"$def"
  17. path=$path/$file
  18. if [ -x $path ]; then
  19. eval "${func:-$file} () { $path \"\$@\"; }"
  20. else
  21. echo "$0: ERROR: Missing: $path" >&2
  22. fi
  23. done
  24. fi
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement