In an effort of keeping things DRY, I am trying to assign a path to a variable that may not exist and have the following script which returns:
/apps/tmp: No such file or directory
#!/bin/bash
$WORKDIR="/apps/tmp"
if [ -d $WORKDIR ]; then
rm -rf $WORKDIR
fi
Is this possible or what work around is there?