| Summary: | internal line numbering is screwed in subshell | ||
|---|---|---|---|
| Product: | Sisyphus | Reporter: | at <at> |
| Component: | bash | Assignee: | placeholder <placeholder> |
| Status: | CLOSED FIXED | QA Contact: | qa-sisyphus |
| Severity: | normal | ||
| Priority: | P2 | CC: | glebfm, ldv, legion, placeholder, vt |
| Version: | unstable | ||
| Hardware: | all | ||
| OS: | Linux | ||
Seems to be fixed in bash-3.0 Fixed in 3.1.1-alt1. ash still not fixed, but I don't care. |
$ cat test.sh : while getopts d: opt; do case "$opt" in d) dir="$(readlink -ev "${OPTARG:?}")" ;; *) exit 2 ;; esac done $ bash -e test.sh -d '' test.sh: line 1: OPTARG: parameter null or not set $ ash -e test.sh -d '' test.sh: 7: OPTARG: parameter not set or null $ Why does bash says it was line 1? I guess when bash enters subshell, internal line counter is reset to 1. And why does ash says it was line 7? It must have been line 4!