Quote:
Originally Posted by jlinkels
I admit: I am too lazy to copy and execute your script. But insert this statement before the line:
Code:
set -x
if [ -z "$frmGroup" ]; then
and see exactly what command is executed by chown. Either the command is not executed, or is executed with parameters you did not expect.
jlinkels
|
Thank You
Here is the new logic and works well
#Logic to check for empty variable in the Group and Owner Field and error control
# -z = if variable is empty
# -n = If variable is not empty
#
set -x
if [ -z "$frmGroup" ]; then
echo "Group Empty"
exit 1
elif [ -n "$frmGroup" ]; then
chgrp $frmGroup $frmPath$frmDirName
fi
if [ -z "$frmChgOwn" ]; then
echo "Change Owner Empty"
exit 1
elif [ -n "$frmChgOwn" ]; then
chown $frmChgOwn $frmPath$frmDirName
fi