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

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -