title: Splitting /proc/cmdline arguments with spaces
body: <p>Most scripts that parse /proc/cmdline break it up into words and then filter out arguments with a case statement, example:</p>
  
  <pre><code>CMDLINE="quiet union=aufs wlan=FOO"
  for x in $CMDLINE
  do
  »···case $x in
  »···»···wlan=*)
  »···»···echo "${x//wlan=}"
  »···»···;;
  »···esac
  done
  </code></pre>
  
  <p>The problem is when the WLAN ESSID has <strong>spaces</strong>. Users expect to set <code>wlan='FOO</code>
  BAR' (like a shell variable) and then get the unexpected result of <code>'FOO</code> with the above code, since the for loop splits on spaces.</p>
  
  <p>Is there a better way of parsing the <code>/proc/cmdline</code> from a shell script falling short of almost evaling it? </p>
  
  <p>Or is there some quoting tricks? I was thinking I could perhaps ask users to entity quote spaces and decode like so: <code>/bin/busybox httpd -d "FOO%20BAR"</code>. Or is that a bad solution?</p>