Files
hpr_website/www/eps/hpr2659/hpr2659_bash11_ex1.sh

16 lines
349 B
Bash
Executable File

#!/bin/bash
#
# A directory we want to create if it doesn't exist
#
BASEDIR="/tmp/testdir"
#
# Check for the existence of the directory and create it if not found
#
if [[ ! -d "$BASEDIR" ]]; then
# Create directory and take action on failure
mkdir "$BASEDIR" || { echo "Failed to create $BASEDIR"; exit 1; }
echo "Created $BASEDIR"
fi