mkdir Command Not Found in shell script within if loop mkdir Command Not Found in shell script within if loop shell shell

mkdir Command Not Found in shell script within if loop


can you run mkdir in your login session?

If you can, most probably the problem is caused by PATH in your script, try suing full path:

if [ ! -e $c ];then/bin/mkdir -p "$c"fi

or export PATH first

PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbinexport PATHif [ ! -e $c ];then/bin/mkdir -p "$c"fi