I just started learning Scripting in Shell Script, RHEL 6.3
This question already has an answer here:
The simplest technique is to use mkdir -p
which creates the directory — and any missing directories up the path — and does not fail if the directory already exists, so you can do it all at once with:
mkdir -p "$LOCAL_WORKING_DIR" "$LOCAL_EVENT_LOG_WORKING_DIR"
Note that the variables are enclosed in double quotes so that even if spaces (etc.) appear in the name, it will work sanely.
链接地址: http://www.djcxy.com/p/17480.html上一篇: 何时在shell变量中引用引号?