Portable shell code between Cygwin and Linux

Sven Köhler sven.koehler@gmail.com
Mon Aug 8 01:20:00 GMT 2011

Am 02.08.2011 14:24, schrieb Sebastien Vauban:
> I don't like copy/pasting things, and just changing bits of the code, if I can
> avoid it.

if you detect cygwin:

pathconvert() {
  // do cygwin specific path conversion of $1

if you don't detect cygwin

pathconvert() {
  echo "$1"

Use the pathconvert command whereever you pass full qualified paths from
cygwin to win32.

(There's one issue here: I would like to write echo -- "$1", but echo
doesn't understand --. Bummer.)

Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

More information about the Cygwin mailing list