I do this in a script:
read direc <<< $(basename `pwd`)
and I get:
Syntax error: redirection unexpected
do it the simpler way,
direc=$(basename `pwd`)
Or use the shell
$ direc=${PWD##*/}