a little shell problem

Bill Warner plug-discuss@lists.plug.phoenix.az.us
11 Oct 2002 12:43:08 -0700


have you tried escaping the newlines with a backslash?

CLIENTS="~joe/foo \
          ~blow/foo \
          ~schmo/blah"

Bill
On Fri, 2002-10-11 at 10:48, Lynn David Newton wrote:
> 
> I'm writing a script (in ksh, not bash, but I believe
> the problem is the same in either shell) where I have
> to write some files to a number of login directories.
> Putting a list of targets in a variable near the top
> like this turns off tilde expansion:
> 
> CLIENTS="~joe/foo
>          ~blow/foo
>          ~schmo/blah"
> 
> The list of clients is potentially rather long, and I'd
> rather set it in an easily modifiable list near the
> front of the script and then later be able to do
> 
> for client in $CLIENTS
> do
>   stuff
> done
> 
> rather than
> 
> for client in ~joe/foo \
>               ~blow/foo \
> 	      ~shmo/blah
> do
>   stuff
> done
> 
> Surely this is an easy thing, but I've got a mental
> block. Can someone help me get my blinders off? Thanks.
> 
> -- 
> Lynn David Newton
> Phoenix, AZ
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change  you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
-- 
Bill Warner
Unix/Linux Admin.
Direct Alliance Corporation

Company required stuff:

Contents are Direct Alliance Corporation Confidential

This message is for the designated recipient(s) only and contains
Direct Alliance Corporation privileged and confidential information.
If you have received it in error, please notify the sender immediately
and delete the original. Any other use of this email is prohibited.
A computer without a Microsoft operating system is like a dog without 
bricks tied to its head.