linux - Why does find result in an empty new line within backticks? -


for reason, resolving variable name within backticks , double quotes causes empty new line.

search="randomsite"; res="`find /var/www -maxdepth 2 -mindepth 2 -type d -name '${search}'`"; echo $res 

use $() rather backticks - easier read , nestable...

res=$(find /var/www -maxdepth 2 -mindepth 2 -type d -name "${search}") 

Comments

Popular posts from this blog

python - matpltolib navigation toolbar edit curves and parameters line color automatically changes issue -

node.js - Nodejs javascript implementation of PBEWithMD5AndTripleDES/CBC/PKCS5Padding -