-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
mkdirs.sh
executable file
·39 lines (37 loc) · 1015 Bytes
/
mkdirs.sh
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
38
39
#!/usr/bin/env sh
# Copyright 2019-2022 (c) all rights reserved by S D Rausty; Please see LICENSE
# https://sdrausty.github.io hosted courtesy https://pages.github.com
# adds directory in RDR from arguments
################################################################################
set -eu
_MKDIRS_ () { # create directories from arguments
ARGS="$@"
NAMESFL=""
for ARG in $ARGS
do
NAMESFL="$NAMESFL $ARG"
done
for DIR in $NAMESFL
do
if [ ! -e "$RDR/$DIR" ] # DIR does not exist in RDR
then # create directory DIR in RDR
mkdir -p "$RDR/$DIR" || printf "%s" "Signal generated at mkdir -p $RDR/$DIR ${0##*/} mkdirs.sh : Continuing : "
fi
done
}
_MKRDIRS_ () { # create list from arguments
ARGS="$@"
NAMESFL=""
for ARG in $ARGS
do
NAMESFL="$NAMESFL $ARG"
done
for DIR in $NAMESFL
do
if [ ! -e "$RDR/$DIR" ] # DIR does not exist in RDR
then # create directory DIR in RDR
mkdir -p "$RDR/$DIR" || printf "%s" "Signal generated at mkdir -p $RDR/$DIR ${0##*/} mkdirs.sh : Continuing : "
fi
done
}
# mkdirs.sh EOF