source: trunk/athena/lib/zephyr/ensure-dir.sh @ 10363

Revision 10363, 337 bytes checked in by ghudson, 27 years ago (diff)
Pull in sources from zephyr locker. See /mit/zephyr/repository for detailed change information.
  • Property svn:executable set to *
Line 
1#!/bin/sh
2
3pathname=$1
4mode=$2
5OLDIFS="${IFS}"; IFS=/; set $pathname; IFS="${OLDIFS}"
6
7case $pathname in
8        /*)     partial=/; ;;
9        *)      partial=""; ;;
10esac
11
12for i do
13        case i in "") continue; ;; esac
14        partial="${partial}${i}"
15        if [ ! -d ${partial} ]; then
16                mkdir ${partial} || exit 1;
17                chmod ${mode} ${partial}
18        fi
19        partial="${partial}/"
20done
21
Note: See TracBrowser for help on using the repository browser.