This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygwin-email utility clipping attached zips


And thank you as well Brian.

I'm still fairly new to bash scripting, and am unfamiliar with all of the tools that make our lives easier.

Thanks for the additions.

Regards,
joey


Brian Dessent wrote:
Saro Engels wrote:

I wasn't right:
It should be:
$ file=*.pdf; file=`echo $file | sed "s/ /,/g"`
$ echo $file
$ email user@domain.com -s test -a $file < sample.txt

Firstly this can be simplified to simply:


email user@example -s test -a $(echo *.pdf|sed "s/ /,/g") <sample.txt

but this will not work if any filename or pathname contains spaces.  You
can solve that with:

email user@example -s test -a "$(sh -c 'IFS=,; echo "$*"' -- *.pdf)" \
		<sample.txt

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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]