> 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]

Yes you are right, it does work. I also tested dash which also barfed. 
Only bash works without the \. Denys you can remove that work around. 
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to