From mboxrd@z Thu Jan 1 00:00:00 1970 From: stefano babic Date: Mon, 20 Oct 2008 09:50:55 +0200 Subject: [U-Boot] [PATCH] Handle environment variables like commands In-Reply-To: <20081019120515.361E6832E43A@gemini.denx.de> References: <> <1224078992-16173-1-git-send-email-sbabic@denx.de> <20081019120515.361E6832E43A@gemini.denx.de> Message-ID: <48FC385F.6090506@babic.homelinux.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: > > The idea of the extension is that something like > > => bootm ${kernel} ${fdt} ${ramdisk} > > will still work. > > Unfortunately, it doesn't, as we have no way to pass the arguments to > the (substituted) command to the commands run in the executed script. yes, that is true ;(. Arguments are not passed to the underlying script. > One idea to solve this problem would be to introduce positional > parameters, similar to how it's being done in the shell. In the > script, we could then refer to the original command args using "$1", > "$2", ... so the example above would look like that: > > => setenv bootm 'echo Run bootm command; builtin bootm $1 $2 $3" Ok, I understand. We need the same behavior as in the real shell to perform this. > I have to admit that I didn't spend much thought on this yet, so all > feedback or sugggestions of alternative / better ideas is > welcome. I admit I have no better ideas...with positional parameters we can start even some complex scripts. I take a look how to implement them, if there are no other suggestions. Best regards, Stefano Babic -- stefano GPG Key: 0x55814DDE Fingerprint 4E85 2A66 4CBA 497A 2A7B D3BF 5973 F216 5581 4DDE