From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Sat, 26 Sep 2020 16:13:29 +0200 Subject: [PATCH 0/3] add "call" command In-Reply-To: References: <20200925111942.4629-1-rasmus.villemoes@prevas.dk> <4b00225d-d960-4a14-9aec-110ddddf7f30@gmx.de> <4118922.1601039395@gemini.denx.de> <99821acf-b921-2c06-05b8-dd32058f28f2@gmx.de> <4185559.1601110290@gemini.denx.de> Message-ID: <6503.1601129609@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Heinrich, In message you wrote: > > > Nice idea! Only we should do a better syntax (options preceeding > > argument), i. e. > > > > run [ --args argv ] varname1 varname2 ... > > > > where argv would be the name of a variale to hold the arguments (as > > a comma (?) separated list) ? > In another mail you suggested "run arg1 arg2 ... -- varname1 varname2". I was commenting on another suggestion. > Whether arguments or script names are first or last does not make much > of a difference for the implementation effort. Any way you have to loop > over all arguments to find the separator "--". It does not make a differenc in terms of implementation, but tradition in UNIX systems is to have command_name [ -options ... ] arguments i. e. options always came first. It is only later tools that ignored how a proper program (TM) should behave ;-) > "better syntax" does not apply here as the two alternatives have the > same expressivity, and need the same amount of typing and learning. It > is a matter of taste. Indeed. One is more pretty, and the other one is more ugly ;-) > > Do you have an idea how the "script" would pull out the arguments > > from that variable? > > Rasmus already suggested $1 .. $9 for the positional arguments (where > counting should not stop at 9). Fine with me. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The universe does not have laws - it has habits, and habits can be broken.