I want to set a shell variable for the output of a following command :
basename $(realpath $DIR) //$DIR is a softlink
when I do :
set FOLDER_NUM=$(basename $(realpath $DIR))
and source the script , it says :
Illegal variable name.
Im expecting to get the folder name of realpath of $DIR into FOLDER_NUM variable .
example :
$DIR is "/usr/kate/latest"
realpath $DIR
will give /usr/kate/12134
I want to set FOLDER_NUM=12134