scripts

Vanalme Filip F.Vanalme at TELEVIC.com
Tue Mar 1 09:06:19 EST 2011


> -----Original Message-----
> From: barebox-bounces at lists.infradead.org [mailto:barebox-
> bounces at lists.infradead.org] On Behalf Of Vanalme Filip
> Sent: dinsdag 1 maart 2011 9:02
> To: Marc Kleine-Budde
> Cc: barebox at lists.infradead.org
> Subject: RE: scripts
> 
> > -----Original Message-----
> > From: Marc Kleine-Budde [mailto:mkl at pengutronix.de]
> > Sent: maandag 28 februari 2011 17:12
> > To: Vanalme Filip
> > Cc: barebox at lists.infradead.org
> > Subject: Re: scripts
> >
> > On 02/28/2011 05:09 PM, Marc Kleine-Budde wrote:
> > > On 02/28/2011 05:03 PM, Vanalme Filip wrote:
> > >> I'm currently studying some Barebox scripts (i.e. init, boot) and I have noticed
> > something strange with scripts :
> > >>
> > >> barebox:/env/bin echo $bootfile
> > >> zImage
> > >> barebox:/env/bin echo $eth0.serverip
> > >> 10.0.48.80
> > >> barebox:/env/bin cat test
> > >> #!/bin/sh
> > >>
> > >> echo --$eth0.serverip--
> > >> echo --$bootfile--
> > >
> > > try:
> > >
> > > echo --${bootfile}--
> >
> > If that doesn't make a difference, try to "source" the config file in your script, e.g.:
> >
> > source /env/config
> 
> [Filip]
> That's it. I forgot to source the config file. Thanks!
> 

[Filip] 
One more question about barebox scripts (I guess even scripts in general...). This is part of a script from another board (that I took over for my own board):

#!/bin/sh

. /env/config

If [ x$1 = xflash ]; then
	root=flash
	kernel=flash
fi

if [ x$1 = xnet ]; then
	root=net
	kernel=net
fi

why the scripts are using i.e. [ x$1 = xflash ] instead of just simply [ $1 = flash ] ? Both are doing the same, no ?

> >
> > cheers, Marc
> > --
> > Pengutronix e.K.                  | Marc Kleine-Budde           |
> > Industrial Linux Solutions        | Phone: +49-231-2826-924     |
> > Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
> > Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox



More information about the barebox mailing list