cygpath -m behaviour change
Robert Klemme
shortcutter@googlemail.com
Tue Sep 17 09:33:00 GMT 2013
On Mon, Sep 16, 2013 at 11:56 AM, David Griffiths
<david.griffiths@gmail.com> wrote:
>> Yes, that's exactly right, assuming that 'boo' doesn't exist.
>
> Hi, it happens even if boo does exist. To put it in context, the
> script in question was attempting to determine the current directory:
>
> CURRENT_DIR=$(cygpath -ma "${0}"/../)
I am confused: do they need the current directory or the directory
where the script resides? The use of -m also sounds a bit weird to
me. I'd rather use -u or -w depending on who is supposed to use the
value (i.e. a Windows process or a Unix Cygwin process).
> (I didn't write this script but I assume they did this for performance reasons.)
For the same I'd rather do
DIR_OF_SCRIPT=$(dirname "$0") && test -d "$DIR_OF_SCRIPT" || exit 1
> But anyway, as you can see ${0} always exists.
$ dash -c 'echo $0; for a; do echo "arg: $a"; done'
dash
$ dash -c 'echo $0; for a; do echo "arg: $a"; done' bla
bla
$ dash -c 'echo $0; for a; do echo "arg: $a"; done' bla foo
bla
arg: foo
$ dash -c 'echo $0; for a; do echo "arg: $a"; done' -- bla foo
--
arg: bla
arg: foo
Kind regards
robert
--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
--
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