delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/01/09/09:14:18

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Jay <jmandawg AT hotmail DOT 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 DOT 20080109T014917-334 AT post DOT gmane DOT org> <47845595 DOT 5040406 AT byu DOT net>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019