Bug 4768
Summary: | getopts (built-in bash function) problem | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | giulioo |
Component: | bash | Assignee: | Bernhard Rosenkraenzer <bero> |
Status: | CLOSED WORKSFORME | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.0 | CC: | pbrown |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 1999-08-31 02:55:53 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: |
Description
giulioo
1999-08-29 11:34:12 UTC
We suggest that you run this script under bash2, which displays the correct behaviour. The bash (v1) behavior may or may not be easily correctable; this bug has been passed along to the bash (v1) package maintainer. You need to put the #!/bin/bash magic at the beginning of each script. If I do that and I have the following scripts mde mode 755 the things are working okay: a1: #!/bin/bash animal=dog while getopts a par do case $par in a) animal=cat ;; esac done echo $animal ./a2 -b a2: #!/bin/bash color=white while getopts b par do case $par in b) color=black ;; esac done echo $color |