Re: [PATCH v2] mergetools: add winmerge as a builtin tool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Quoting Sebastian Schuberth <sschuberth@xxxxxxxxx>:

On Thu, May 14, 2015 at 11:48 PM, SZEDER Gábor <szeder@xxxxxxxxxx> wrote:

for directory in "$(env | grep -E
'^PROGRAM(FILES(\(X86\))?|W6432)=' | cut -d '=' -f 2 | sort -u)"
do
    test -n "$directory" &&
    test -x "$directory/$winmerge_exe" &&
    echo "$directory/$winmerge_exe" &&
    break
done

This ain't gonna work, because the output of the pipe won't be split
because of the quotes around the command substitution, so $directory will
hold everything.  Simply loosing those quotes is not good either, because

That's what I thought at first, too, but simply trying it out proved
me wrong (again, in both MSYS1/2):

$ for d in "$(env | grep -Ei '^PROGRAM(FILES(\(X86\))?|W6432)=' | cut
-d '=' -f 2- | sort -u)"; do echo "$d"; done
C:\Program Files
C:\Program Files (x86)

Note that the path, although they are containing spaces, are on
separate lines.

Yeah, exactly the behavior I described in the part you quoted.
Although it looks good, it's not what you want.
Putting 'echo "** $d **"' in the loop gives me:

** C:\Program Files
C:\Program Files (x86) **

(1.9.5 MSysGit)


Gábor
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]