|
Bugzilla – Full Text Bug Listing |
| Summary: | string tests in ksh do not work properly | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE 11.0 | Reporter: | John Young <j.e.young> |
| Component: | Other | Assignee: | Dr. Werner Fink <werner> |
| Status: | RESOLVED WONTFIX | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | ||
| Version: | Final | ||
| Target Milestone: | --- | ||
| Hardware: | x86-64 | ||
| OS: | openSUSE 11.0 | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
Please report this *upstream* as I'm not the author of the ksh.
I'm only the maintainer. Beside the pdksh is not compatible with
the original ksh (here ksh93) ... do you have ever tried
#! /bin/ksh
cmdname="job"
prod="foo"
[[ $cmdname =~ ${prod}[1-9][0-9]* ]] && {
echo test 1 passed
}
cmdname="foo"
[[ $cmdname =~ ${prod}[1-9][0-9]* ]] && {
echo test 2 passed
}
cmdname="foo2007"
[[ $cmdname =~ ${prod}[1-9][0-9]* ]] && {
echo test 3 passed
}
|
How to reproduce the problem: If you run the following short test script with /bin/pdksh, it works correctly. If you run it with /bin/ksh (being a link to /lib64/ast/bin/ksh), the output is incorrect: #! /bin/ksh cmdname="job" prod="foo" [[ $cmdname = $prod[1-9][0-9]* ]] && { echo test 1 passed } cmdname="foo" [[ $cmdname = $prod[1-9][0-9]* ]] && { echo test 2 passed } cmdname="foo2007" [[ $cmdname = $prod[1-9][0-9]* ]] && { echo test 3 passed } linuxhost{username}% ./foo.ksh test 1 passed test 2 passed test 3 passed It really should be: linuxhost{username}% ./foo.ksh test 3 passed (Sorry -- this was the case under 10.3 also, but I thought you all would find it. I probably should have reported it earlier. )