Bug 487785
| Summary: | bash: highlight upgrade to 4.1 from 3.2 | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Andrew Hecox <ahecox> |
| Component: | doc-Migration_Guide | Assignee: | Laura Bailey <lbailey> |
| Status: | CLOSED NEXTRELEASE | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | low | ||
| Version: | 6.0 | CC: | akarlsso, rvokal, sradvan, syeghiay |
| Target Milestone: | rc | Keywords: | Documentation |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2010-04-18 06:04:28 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 562999, 588757 | ||
|
Description
Andrew Hecox
2009-02-27 21:20:49 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux major release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Major release. This request is not yet committed for inclusion. >38. Since bash-4.0 now follows Posix rules for finding the closing delimiter
> of a $() command substitution, it will not behave as previous versions
> did, but will catch more syntax and parsing errors before spawning a
> subshell to evaluate the command substitution.
I think, this would cause problems for customers. In bash-3.2 you may have:
e=$(cat << EOF
contents
EOF)
echo "$e"
and it's ok, but only in bash-3. In bash-4 you get
./bla.sh: line 2: unexpected EOF while looking for matching `)'
./bla.sh: line 7: syntax error: unexpected end of file
because end of here-document must be alone on line with end of line marker and with no spaces. So the right script should be:
e=$(cat << EOF
contents
EOF
)
echo "$e"
Ulrich also pointed out:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
l. The shell now has the notion of a `compatibility level', controlled
by new variables settable by `shopt'. Setting this variable
currently restores the bash-3.1 behavior when processing quoted
strings on the rhs of the `=~' operator to the `[[' command.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
this actually covers a 3.1 -> 3.2 change, but may be worth noting.
reviewing customer issues from the bash 2.x to bash 3.x rebase (EL 3 -> EL4), we had: - two issues where a customer started using a bash 3.x feature/fix, updated their scripts, and reported a bug in bash 2.x. - one performance issue related to a new feature (multibyte character support) - a change (not clear if intentional) in the ./configure options, via the .spec On the last point, Roman: any changes to the .spec file when you rebased in F11? Only one change - there is missing bash-doc. I don't generate it during building, user can generate it by himself. you mean the .ps files in /usr/share/doc/bash*/ ? yes
from NEWS
m. The `ulimit' builtin now has new -b (socket buffer size) and -T (number
of threads) options.
I don't see these options in the rawhide version of bash though ..
E14) Why does quoting the pattern argument to the regular expression matching
conditional operator (=~) cause regexp matching to stop working?
In versions of bash prior to bash-3.2, the effect of quoting the regular
expression argument to the [[ command's =~ operator was not specified.
The practical effect was that double-quoting the pattern argument required
backslashes to quote special pattern characters, which interfered with the
backslash processing performed by double-quoted word expansion and was
inconsistent with how the == shell pattern matching operator treated
quoted characters.
In bash-3.2, the shell was changed to internally quote characters in single-
and double-quoted string arguments to the =~ operator, which suppresses the
special meaning of the characters special to regular expression processing
(`.', `[', `\', `(', `), `*', `+', `?', `{', `|', `^', and `$') and forces
them to be matched literally. This is consistent with how the `==' pattern
matching operator treats quoted portions of its pattern argument.
Since the treatment of quoted string arguments was changed, several issues
have arisen, chief among them the problem of white space in pattern arguments
and the differing treatment of quoted strings between bash-3.1 and bash-3.2.
Both problems may be solved by using a shell variable to hold the pattern.
Since word splitting is not performed when expanding shell variables in all
operands of the [[ command, this allows users to quote patterns as they wish
when assigning the variable, then expand the values to a single string that
may contain whitespace. The first problem may be solved by using backslashes
or any other quoting mechanism to escape the white space in the patterns.
Bash-4.0 introduces the concept of a `compatibility level', controlled by
several options to the `shopt' builtin. If the `compat31' option is enabled,
bash reverts to the bash-3.1 behavior with respect to quoting the rhs of
the =~ operator.
(In reply to comment #0) [snip] 43. Bash-4.0 fixes a Posix mode bug that caused the . (source) builtin to search the current directory for its filename argument, even if "." is not in $PATH. Posix says that the shell shouldn't look in $PWD in this case. 44. Bash-4.1 uses the current locale when comparing strings using the < and > operators to the `[[' command. This can be reverted to the previous behavior by setting one of the `compatNN' shopt options. covered in migration guide for beta |