|
|
1.1 ! root 1: # Some handy shell-script utilities for the shell scripts that drive the ! 2: # 'devadm' command. ! 3: ! 4: # Call with the $0 of the script as a parameter; this commands writes the ! 5: # name of the directory containing the script to standard output. ! 6: # Example: ! 7: # conf_path $0 ! 8: ! 9: conf_path () { ! 10: set `which $1 2>/dev/null` X ! 11: if [ $# -ne 2 ]; then ! 12: echo . # Assume the current directory. ! 13: return 1 ! 14: fi ! 15: set `expr $1 : '\(.*\)/.*'` X ! 16: if [ $# -ne 2 ]; then ! 17: echo . # Must be in the current directory. ! 18: else ! 19: echo $1 ! 20: fi ! 21: return 0 ! 22: } ! 23:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.