X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Jay <jmandawg@hotmail.com>
Subject:  Re: need help with bash -c <command> with cygpath
Date: Wed, 9 Jan 2008 14:13:15 +0000 (UTC)
Lines: 31
Message-ID:  <loom.20080109T133322-382@post.gmane.org>
References:  <loom.20080109T014917-334@post.gmane.org> <47845595.5040406@byu.net>
Mime-Version:  1.0
Content-Type:  text/plain; charset=us-ascii
Content-Transfer-Encoding:  7bit
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

> Whoa - it seldom makes sense to use -i and -c simultaneously - what good

What i'm actually trying to do is have a right-click menu in windows so that
when i right click on a file i can choose head from the context menu, and it
will send the top 10 lines of the file to vim.  I have gvim (windows version)
aliased in my .bashrc so that's why i'm using the -i switch.

What i have done is created the following registry key:
[HKEY_CLASSES_ROOT\*\shell\Head\Command]
with the (default) value set to: 
C:\CYGWIN\bin\bash -i -c "head $(cygpath -a '%1') | vim -R -"

This works perfectly for local files, but does not work at all for network
shares via UNCs due to the problem stated earlier.

> bash -c "cygpath -a '"'\\uncpath\mydrive$'\'

This works! but i can't figure out how to make it work for this scenario

bash -i -c "head $(cygpath -a 
"'\\gandy1\rjapps$\Subsidiarypayroll\Web.config'"')"

Maybe i have the quotes messed up, or maybe i'm going about doing this all wrong.

> By the way, none of this tutorial on shell quoting is cygwin specific.

Thanks again for the help.  






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

