Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-5634

wrong evaluation of empty string

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Undefined Undefined
    • None
    • rhel-9.0.0
    • bash
    • None
    • None
    • rhel-sst-cs-plumbers
    • ssg_core_services
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None

      Description of problem:
      While running reproducers for bug 2062291, I have found that exit codes differ between RHEL7 and RHEL9.

      Version-Release number of selected component (if applicable):
      bash-5.1.8-4.el9.x86_64

      How reproducible:
      always

      Steps to Reproduce:
      1. create test script (bz2062291-2.sh) containing
      set – $'\t'; IFS=$1 A=$1
      [[ $@ ]]
      2. bash bz2062291-2.sh ; echo $?

      Actual results:
      0

      Expected results:
      1

      Additional info:
      No arguments are passed to the testscript, so $@ should be empty.
      Reading the manpage, there are two possibilities how to test non-zero lenght of a string, either using '-n string' or omitting the -n, so the test parentheses [[ ]] containing empty string should result in false, thus I believe the RHEL7 version is correct and RHEL9 version is wrong.

              rhn-support-svashish Siteshwar Vashisht
              kvolny Karel Volný
              Siteshwar Vashisht Siteshwar Vashisht
              Karel Volný Karel Volný
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: