<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>7671</bug_id>
          
          <creation_ts>2005-08-14 02:51:32 +0400</creation_ts>
          <short_desc>internal line numbering is screwed in subshell</short_desc>
          <delta_ts>2006-01-07 00:58:46 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>bash</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="at@altlinux.org">at</reporter>
          <assigned_to name="placeholder@altlinux.org">placeholder</assigned_to>
          <cc>glebfm</cc>
    
    <cc>ldv</cc>
    
    <cc>legion</cc>
    
    <cc>placeholder</cc>
    
    <cc>vt</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>28660</commentid>
    <comment_count>0</comment_count>
    <who name="at@altlinux.org">at</who>
    <bug_when>2005-08-14 02:51:34 +0400</bug_when>
    <thetext>$ cat test.sh
:
while getopts d: opt; do
        case &quot;$opt&quot; in
                d) dir=&quot;$(readlink -ev &quot;${OPTARG:?}&quot;)&quot; ;;
                *) exit 2 ;;
        esac
done
$ bash -e test.sh -d &apos;&apos;
test.sh: line 1: OPTARG: parameter null or not set
$ ash -e test.sh -d &apos;&apos; 
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!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34338</commentid>
    <comment_count>1</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2005-12-31 02:22:52 +0300</bug_when>
    <thetext>Seems to be fixed in bash-3.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34485</commentid>
    <comment_count>2</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2006-01-06 22:04:43 +0300</bug_when>
    <thetext>Fixed in 3.1.1-alt1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34489</commentid>
    <comment_count>3</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2006-01-07 00:58:46 +0300</bug_when>
    <thetext>ash still not fixed, but I don&apos;t care.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>