I keep getting this at stdout "mkdir: usage: mkdir [-m mode] [-p] dirname ..."

This is really odd.

I keep receiving the following line at stdout:

"mkdir: usage: mkdir [-m mode] [-p] dirname ..."

I have the following in my Korn Shell script:

if [[ ! -d $JOB_DIR ]]; then
      mkdir -p "$JOB_DIR"
fi

I tried the mode parameter, but still get this message.

Thoughts or suggestions on how to get rid of this message is greatly appreciated.

Thanks,

--Todd
jtp51Asked:
Who is Participating?
 
ahoffmannConnect With a Mentor Commented:
I guess that $JOB_DIR is unset or empty
0
 
TintinCommented:
Add

echo "dir: $JOB_DIR"

before the mkdir and I think you'll see what the problem is.
0
 
jtp51Author Commented:
ahoffmann: Thanks... sorry guys, I had echoed the variable before and saw a value; however I had made more changes since.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.