Problem with command substitution in mksh shell after upgrading to Cygwin 1.7.26
Corinna Vinschen
corinna-cygwin@cygwin.com
Wed Dec 4 09:13:00 GMT 2013
On Dec 4 03:22, PRIKHODKO, GEORGE wrote:
> Hi,
>
> After upgrading to Cygwin to 1.7.26 the commands:
>
> print $(getIP)
> print $(ipconfig | grep "IPv4 Address" | sort | head -1 | cut -d ":" -f 2 \
> | sed -e "s/ *\\([0-9.]*\\).*/\\1/")
>
> in the following script
>
> #!/usr/bin/ksh
>
> cv=$(uname -r)
> cv=${cv%\(*}
> cygcheck -s -v -r > cygcheck_$cv.out
>
> exec > test_$cv.log 2>&1
> set -xv
>
> getIP() {
> ipconfig | grep "IPv4 Address" | sort | head -1 | cut -d ":" -f 2 \
> | sed -e "s/ *\\([0-9.]*\\).*/\\1/"
> }
> #
> # the following four commands should print IP address 4 times
> #
> getIP
>
> print $(getIP)
>
> ipconfig | grep "IPv4 Address" | sort | head -1 | cut -d ":" -f 2 \
> | sed -e "s/ *\\([0-9.]*\\).*/\\1/"
>
> print $(ipconfig | grep "IPv4 Address" | sort | head -1 | cut -d ":" -f 2 \
> | sed -e "s/ *\\([0-9.]*\\).*/\\1/")
>
> exit
>
> started to produce incorrect results.
> test_1.7.26.log shows instead of IP address a whole output of ipconfig is printed for these lines.
>
> /usr/bin/ksh, used in the script, is a symbolic link to /usr/bin/mksh
>
> Please, let me know if you need more info to research the problem.
No, thank you. I could track down the culprit of the problem.
I don't have a fix yet, but it will be fixed in 1.7.27, which
will be due really soon.
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20131204/11382d6c/attachment.sig>
More information about the Cygwin
mailing list