How do I Assign directory path to a variable during mkdir in shell script without cd? How do I Assign directory path to a variable during mkdir in shell script without cd? shell shell

How do I Assign directory path to a variable during mkdir in shell script without cd?


Just create the variables at the beginning of your script and use them later in your mkdir as following:

LOGPATH=/path/to/somedir....mkdir -p ${LOGPATH} ....