|
Check if file is directory (-d) using case sensitive
Hi,
I am writing a bash script. At the beginning of the script there is a user defined variable which is a directory in which processed data will be moved. When running the script I would like to immediately make sure that the directory exists, and if not the script will error. The following code should do that:
OUTDIR='/Users/msb65/test_data'
if [ -d $OUT_DIR ]; then
echo '- OUT_DIR exists'
else
echo; echo; echo 'ERROR: OUT_DIR does not exist'
exit 1
fi
However, this test does NOT seem to be case sensitive. How can I make it so it is? Thanks.
Mike
|