On Tue, 15 Apr 2008, James Simmons wrote:

> This fails.
>
> runlevel=$(cat /proc/1/cmdline 2> /dev/null)
> echo $runlevel                                        # init [2]
> runlevel=${runlevel#* [}
>
> echo "runlevel '$runlevel'"                   # Should be runlevel '2]'
>                                               # we get runlevel 'init [2]'

Hmm...

But:

  # runlevel=${runlevel#* \[}
  # echo $runlevel
  2]


Cheers,

-- 
Cristian
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to