Subject: Re: Iterating through "fields" in a list
To: None <netbsd-users@netbsd.org>
From: Eric Fox <eric@fox.phoenix.az.us>
List: netbsd-users
Date: 02/01/2007 06:27:32
How about:
ENCTO=`echo $ENCTO | sed -e 's/ / -r /g'`
Then just use it as you already do:
gpg -r $ENCTO
/\---/\ Eric J Fox
/ o o \ http://fox.phoenix.az.us/
\.\ /./ ---------------------------
\@/ "Of course it runs NetBSD."
Jan Danielsson wrote:
> Hello all,
>
> (Using /bin/sh)
>
> I have a set of backup scripts which contain this:
>
> tar .... | bzip2 | gpg -r $ENCTO > blarg.tar.bz2.gpg
>
> ENCTO is a variable which is set prior to running the scrips. Now I
> have realized that I need to encrypt to several recipients. I.e.:
>
> tar .... | bzip2 | gpg -r foo -r bar > blarg.tar.bz2.gpg
>
> Is there some painfully obvious way to construct the string:
>
> "-r foo -r bar"
>
> from the environment variable:
>
> ENCTO=foo bar
>
> (Using space as separator)
>
> "for" obviously uses file names, and doesn't seem to be able to use
> space separated lists for processing.
>
> (Don't even suggest that I should create two files named "foo" and
> "bar" somewhere so that I can use "for". Even I realize how ugly *that*
> is. ;-)
>
>