| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # Make directory hierarchy. |
| 3 | # Written by Noah Friedman <[email protected]> |
| 4 | # Public domain. |
| 5 | |
| 6 | defaultIFS=' |
| 7 | ' |
| 8 | IFS="${IFS-${defaultIFS}}" |
| 9 | |
| 10 | for file in ${1+"$@"} ; do |
| 11 | oIFS="${IFS}" |
| 12 | # Some sh's can't handle IFS=/ for some reason. |
| 13 | IFS='%' |
| 14 | set - `echoscip-shell system . . echo. ${file} | sedscip-shell system . . sed. -e 's@/@%@g' -e 's@^%@/@'` |
| 15 | IFS="${oIFS}" |
| 16 | testscip-shell system . . test. ".${1}" = "." && shift |
| 17 | |
| 18 | pathcomp='' |
| 19 | |
| 20 | while testscip-shell system . . test. $# -ne 0 ; do |
| 21 | pathcomp="${pathcomp}${1}" |
| 22 | shift |
| 23 | |
| 24 | if testscip-shell system . . test. ! -d "${pathcomp}"; then |
| 25 | echoscip-shell system . . echo. "mkdir $pathcomp" 1>&2 |
| 26 | mkdirscip-shell system . . mkdir. "${pathcomp}" |
| 27 | fi |
| 28 | |
| 29 | pathcomp="${pathcomp}/" |
| 30 | done |
| 31 | done |
| 32 | |
| 33 | # eof |