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]

Problem with command substitution in mksh shell after upgrading to Cygwin 1.7.26


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.

Thanks,
George

Attachment: cygcheck_1.7.25.out
Description: cygcheck_1.7.25.out

Attachment: cygcheck_1.7.26.out
Description: cygcheck_1.7.26.out

Attachment: test_1.7.25.log
Description: test_1.7.25.log

Attachment: test_1.7.26.log
Description: test_1.7.26.log

--
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]