title: Why find command failing from make file
body: <p>I am working on modifying a windows make file. The file, which is part of legacy build code has the following lines --</p>
  
  <pre><code>    WROOT := "MyBuild/win/Program Files/Windows Kits/10" 
  
  
     ROOT_SDK_Version := $(shell find $(WROOT_WIN10_SDK)/Include -maxdepth 1 -type d -path $(WROOT_WIN10_SDK)/Include/[0-9.]* )
  </code></pre>
  
  <p>The SHELL variable is mapped to bin/sh but when I print the variable ROOT_SDK_Version, it is empty. However, when I manually invoke the find command with the same arguments, it is giving the expected out.</p>
  
  <p>To debug this issue, I modified above line in make file as below</p>
  
  <pre><code>ROOT_SDK_Version := $(shell find $(WROOT_WIN10_SDK)/Include -maxdepth 1 -type d -path $(WROOT_WIN10_SDK)/Include/[0-9.]* 2&gt; output.txt )
  </code></pre>
  
  <p>And I see the contents of the file output.txt after running make -</p>
  
  <pre><code>find: paths must precede expression
  Usage: find [-H] [-L] [-P] [path...] [expression]
  </code></pre>
  
  <p>So why is the find command failing when running from make file but is successful when I run it manually using the same arguments? Any pointers appreciated.</p>
  
  <p>Providing more context-</p>
  
  <p>WROOT_WIN10_SDK := "$(GOBUILD_CAYMAN_MSVC_DESKTOP_ROOT)/win/Program Files/Windows Kits/10" </p>
  
  <p>The variable GOBUID...is== E:/Myscpetre20/depot/sim/sim-20fq1/build/gobuild/compcache/cayman_msvc_desktop/ob-11144741/windows2016-clean</p>
  
  <p>So WROOT_WIN10_SDK is == "E:/Myscpetre20/depot/sim/sim-20fq1/build/gobuild/compcache/cayman_msvc_desktop/ob-11144741/windows2016-clean/win/Program Files/Windows Kits/10"</p>