I don't think the first string qualifies as a list in the true sense of 
the word. For instance, I think your script breaks if I pass it 'one     
two three         four' 

Furthermore, bash pipelines aren't going to translate easily to 
traditional languages.

Ed

Robert Citek wrote:
> On Feb 23, 2006, at 11:06 AM, Ed Howland wrote:
>   
>> I was working in a deficient language today and needed something to
>> create a comma separated string from a list. I.e. given (one two three
>> four) => "one, two, three, four"
>>     
>
> I'm guessing that sed is not quite what you were looking for:
>
> $ echo 'one two three four' | sed -e 's/ /, /g'
>
> Regards,
> - Robert
> http://www.cwelug.org/downloads
> Help others get OpenSource software.  Distribute FLOSS
> for Windows, Linux, *BSD, and MacOS X with BitTorrent
>
>  
> _______________________________________________
> CWE-LUG mailing list
> [email protected]
> http://www.cwelug.org/
> http://www.cwelug.org/archives/
> http://www.cwelug.org/mailinglist/
>   

-- 
Ed Howland
WDT Solutions, LLC.
[EMAIL PROTECTED]
(314) 962-0766

 
_______________________________________________
CWE-LUG mailing list
[email protected]
http://www.cwelug.org/
http://www.cwelug.org/archives/
http://www.cwelug.org/mailinglist/

Reply via email to