erlug
[Top] [All Lists]

Re: [Erlug] same old... shell script

To: ERlug - Lista Pubblica <erlug@xxxxxxxxxxxxxx>
Subject: Re: [Erlug] same old... shell script
From: Davide Brini <db72@xxxxxxxxxxxx>
Date: Thu, 17 Jul 2008 15:43:25 +0200
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.

<Prev in Thread] Current Thread [Next in Thread>