[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strings with ':'
From: |
Andrew Stribblehill |
Subject: |
Re: Strings with ':' |
Date: |
Tue, 17 Sep 2002 11:02:47 +0100 |
User-agent: |
Mutt/1.4i |
Quoting David Douthitt <ssrat@mailbag.com> (2002-09-16 07:38:24 BST):
> In a control section, how do I assign a string to
> a variable when the string contains ':' (or any other
> "list" character)?
>
> In this case, I was using a URL:
>
> control:
> myvar = ( ftp://name:passwd@site/some/dir/on/site )
>
> I tried using " (double-quote), ' (single-quote),
> and escaping the ":" with back-slash; nothing worked.
> I use the ":" in other places as an actual list separator
> (such as using $PATH!) so I don't want to just change it.
>
> Besides, that doesn't answer the question: how do you
> remove the meaning of the list separator character in
> a string?
Not an answer for you but a suggestion for the future of cfengine...
If we had a function, say 'split', we could use:
mydirs = ( split(foo:bar:baz:quux) )
Unfortunately, this would break backward-compatibility, so maybe you
could do with a literal() function instead. I reckon I could knock up
a split() function but writing literal() would mean mucking around
with more of cfengine's dark magic than I currently understand.
--
FITZROY
EAST OR NORTHEAST 5 OR 6, BECOMING CYCLONIC 4 IN SOUTH LATER.
THUNDERY RAIN OR SHOWERS. MODERATE OR GOOD
- Strings with ':', David Douthitt, 2002/09/16
- Re: Strings with ':',
Andrew Stribblehill <=