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/tmpif [ -d $WORKDIR ]; then     rm -rf $WORKDIRfiIs this possible or what work around is there?
Assign path to variable which does not exist
bash;shell;variable
When you create new variable, you are not using dollar $ sign. Just do:WORKDIR=/apps/tmp