On Thursday 17 July 2008, 15:27, Federico Calboli wrote:
> > 1) Do you know how i might (in a mindless kind of way) pass typed
> > arguments through to an invoked application from within a bash shell
> > script? I used to be able to do this fine using tsch, but have now
> > forgotten. For example, i'd like to be able to do something like :
> >
> > #!/bin/sh
> >
> > application1
> > < input_file
> > < map
> > < yes
> > < no
> > < end
> >
> > application2
> > < reply to prompts
> > <
> >
> > end_of_shell_script
Se ho capito bene, qui basta fare
(echo input_file;echo map;echo yes;echo no;echo end) | application1
ipotizzando che application1 legga da stdin. Se invece input_file e' un
file, e lui vuole redirigere l'input di application1 collegandolo a
input_file *E* fargli leggere anche le altre stringhe, allora questo:
(cat input_file;echo map;echo yes;echo no;echo end) | application1
> > 2) Related to this, would you know how i could pass two arguments
> > to the linux command "passwd" using one command line? e.g.
> > something like:
> >
> > echo "passwd1 \n" "passwd1 \n" | passwd username
Non mi pareva che passwd leggesse da stdin (perlomeno, non nel mio
sistema). Un modo per cambiare una password in modo non interattivo e'
usare usermod -p.
|