As it stands, your script is trying to run the file named in $nquo
first with the environment variable dirn
set to the value dirname
, and then with the variable bnam
set to the value basename
. Since it is not executable, you get the error message about not being able to execute the file.
You presumably intended to run the commands on the name of the file, which requires either back-ticks or (preferably) $(...)
around it:
dnam=$(dirname "$nquo")
bnam=$(basename "$nquo")