Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Message-Id: <5.2.0.9.2.20030214211012.0294ea38@pop3.cris.com> X-Sender: rrschulz AT pop3 DOT cris DOT com Date: Fri, 14 Feb 2003 21:14:06 -0800 To: cygwin AT cygwin DOT com From: Randall R Schulz Subject: Re: Win 2000 : Open Files With Word & Excel From The Command Line Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Steve, Double damn! Or maybe... Third time's the charm. Yeah, that's it! -==- #!/bin/bash wwArgs=() for arg; do wwArgs[${#wwArgs[@]}]="$(cygpath -m "$arg")" done exec "/cygdrive/c/Program Files/Microsoft Office/Office/winword.exe" "${wwArgs[@]}" -==- Randall Schulz >Steve, > >Damn. I forgot the part about converting the argument names from >Cygwin / POSIX to Windows. > >This is better: > >-==- >#!/bin/bash > >wwArgs=() > >for arg; do > wwArgs${#wwArgs@]}]="$(cygpath -w "$arg")" >done > >exec "/cygdrive/c/Program Files/Microsoft Office/Office/winword.exe" >"${wwArgs[@]}" >-==- > >Note that to use the array syntax you have to use BASH. > >This is still somewhat limited, in that it assumes all the arguments >to the script are file names. I don't know that WINWORD.EXE accepts >anything else, but if it does and you want to use them, this would >have to be refined further. > >Lastly, I guess there is now some Cygwin-specific aspects to this. > >Randall Schulz -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/