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: Portable shell code between Cygwin and Linux


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


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