X-Spam-Check-By: sourceware.org Message-ID: <45A66903.6070904@wi.rr.com> Date: Thu, 11 Jan 2007 10:42:43 -0600 From: Joey Officer User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: cygwin-email utility clipping attached zips References: <006701c734d6$d8531e00$a501a8c0 AT CAM DOT ARTIMI DOT COM> <45A520B8 DOT 7090802 AT wi DOT rr DOT com> <45A52736 DOT 2040009 AT gmx DOT de> <45A5292A DOT 20606 AT gmx DOT de> <45A52E6C DOT 61D53739 AT dessent DOT net> <17393e3e0701101200m630f651ch5fe9b623fe7d33b AT mail DOT gmail DOT com> <45A64B75 DOT B6ABC9F0 AT dessent DOT net> In-Reply-To: <45A64B75.B6ABC9F0@dessent.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com heh, I seem to have sparked a short debate on bash scripting syntax/verbage. Suffice it to say, my original way worked, this way would most likely work, and I'm sure there are a number of alternative ways to get the same egg scrambled. I appreciate everyone's input, I really just wanted to share how I got it working in case anyone else needed something similar. regards, joey Brian Dessent wrote: > Matt Wozniski wrote: > >>> email user AT example -s test -a "$(sh -c 'IFS=,; echo "$*"' -- *.pdf)" \ >>> > But that won't work for files with commas in the name! (Rare, but it >> can happen...) I'd prefer something like > > This still works fine for filenames with commas since it uses $* which > joins the positional parameters which have already been split (before > the subprocess was even invoked), before IFS is changed to ",". > > But if a filename has a comma in its name then it is impossible to > express it as a list of comma-separated filenames without some form of > quoting. And I doubt that the email program has backslash-escape > parsing logic for this very rare case (but I haven't checked.) > Regardless, this: > >> email user AT example -s test -a "$(ls -1 *.pdf | tr '\n' ',' )" < sample.txt > > ...does not solve the problem either. You get the same output as above, > except with an erronious trailing ",". > > Brian > > -- > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > Problem reports: http://cygwin.com/problems.html > Documentation: http://cygwin.com/docs.html > FAQ: http://cygwin.com/faq/ > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/