This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: Little cygpath improvement request
- From: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder at niaid dot nih dot gov>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Sun, 16 Feb 2014 18:30:15 +0000
- Subject: RE: Little cygpath improvement request
- Authentication-results: sourceware.org; auth=none
- References: <111910987 dot 20140214222230 at mtu-net dot ru> <52FE6397 dot 5010105 at cygwin dot com> <187072112 dot 20140214234339 at mtu-net dot ru> <20140215125606 dot GM2246 at calimero dot vinschen dot de> <1745533059 dot 20140215225708 at mtu-net dot ru> <20140216120042 dot GP2246 at calimero dot vinschen dot de> <40596392 dot 20140216184131 at yandex dot ru> <20140216151107 dot GT2246 at calimero dot vinschen dot de>
Corinna Vinschen sent the following at Sunday, February 16, 2014 10:11 AM
>> > NATIVE=$(cygpath -ml "$2" 2>/dev/null)
>
>And what's the problem with redirections?
>
>I fail to see the big difference between adding a redirection compared
>to adding an option character.
Some of us avoid redirections because we do it so rarely that getting it
correct becomes a long experimental process.
But as an alternative to redirection, one can test for an empty path.
if [ ! -z "$2" ] ; then NATIVE="$(cygpath -ml "$2")" ; fi
- Barry
Disclaimer: Statements made herein are not made on behalf of NIAID.