Afficher un message
Vieux 25/03/2008, 21h40   #3
pk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Accessing params called by a shell script

worldcyclist@gmail.com wrote:

> I guess my question is how do I accomplish this....
> ($MODEL, $COLOR, $YEAR) = `./return_car_values $1`


I don't think you can do that directly with sh, however you can have those
values assigned as positional parameters, eg (assuming return_car_values.pl
returns "model1 red 2005")

ret=`return_car_values.pl`

eval set -- "$ret"

# now $1, $2 and $3 are set to "model1", "red" and "2005" respectively

--
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to mention when something is nonstandard (if
I'm aware of that), but I may miss something. Corrections are welcome.
  Réponse avec citation
 
Page generated in 0,04514 seconds with 9 queries