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
Post a Comment