File: recmkdir

package info (click to toggle)
vflib3 3.6.14.dfsg-3+nmu4
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 11,936 kB
  • sloc: ansic: 36,071; sh: 10,354; asm: 3,290; makefile: 960; lisp: 123; perl: 109; awk: 43
file content (37 lines) | stat: -rwxr-xr-x 399 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/sh
#
# recmkdir - make directory recursively
# by H.Kakugawa
#

case $# in
0)
  echo Usage: recmkdir DIR ...
  exit 1
  ;;
*)
  ;;
esac

for D in $* ; do
  case $D in
  /*) 
    ;;
  *) 
    D=`pwd`/$D
    ;;
  esac
  L=`echo $D | sed 's|/| |g'` 
  set $L
  X=""
  for P in $* ; do
    X=$X/$P 
    if [ ! -d $X ] ; then
      echo mkdir $X
      mkdir $X
    fi
    shift
  done
done

#EOF