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: need help with bash -c <command> with cygpath


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


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