This is the mail archive of the cygwin@cygwin.com 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: Does cygstart always expand arguments?



Igor Pechtchanski wrote:


On Tue, 13 May 2003, Jim Kleckner wrote:
...
FYI, the following works for me:

cygstart gvim '"file with spaces.txt"' '"another file with spaces.txt"'

Yep, you did it, thanks! A gold star for you, though definitely not as valuable as cgf's.

Another case of peeling off layers of
"quoting the quotes".  There must be some
DOS shell buried in there as part of the
invocation or something.

If anyone cares, here is a small bash
snippet that will create either a shell
alias or a function to figure out which
version of gvim/vim/vimx/vi is available
to use.

Note the use of quotes as supplied by
Igor on the line with cygpath.

I'm sure someone out there can simplify
the for loop.

=== bash snippet to determine vim/vi

# To use this type:
# v [list of files to edit]

alias which="type -path"
if [ "$OSTYPE" != "cygwin" ] ; then
    if [ "`which vimx`" != "" ] ; then
        alias v=vimx
    elif [ "`which vim`" != "" ] ; then
        alias v=vim
    else
        alias v=vi
    fi
else
    if [ "`which gvim`" != "" ] ; then
        function v() {
           unset _fs
           _i=0
           for _f in "$@"; do
               _fs[$_i]='"'`cygpath -m "$_f"`'"'
               let _i=$_i+1
           done
           cygstart gvim.exe ${_fs[@]}
        }
    elif [ "`which vimx`" != "" ] ; then
        alias v=vimx
    elif [ "`which vim`" != "" ] ; then
        alias v=vim
    else
        alias v=vi
    fi
fi


-- 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]