[Bug 1715023] [NEW] bash4, here-documents, <<-EOF ... indented EOF terminator errors out.

Andrej Ricnik a.ricnik at gmail.com
Mon Sep 4 21:16:59 UTC 2017


Public bug reported:

This snippet, taken from /etc/bash.bashrc, errors out on the here document, even though the 
man page states that <<-EOF should allow for the terminating EOF to be indented.

#!/bin/bash
# sudo hint
if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then
  case " $(groups) " in *\ admin\ *)
    if [ -x /usr/bin/sudo ]; then
      cat <<-EOF
        To run a command as administrator (user "root"), use "sudo <command>".
        See "man sudo_root" for details.
      EOF
    fi
  esac
fi


Error message is:
./test.sh: line 13: warning: here-document at line 6 delimited by end-of-file (wanted `EOF')
./test.sh: line 14: syntax error: unexpected end of file

** Affects: bash (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: bash

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to open-iscsi in Ubuntu.
https://bugs.launchpad.net/bugs/1715023

Title:
  bash4, here-documents, <<-EOF ... indented EOF terminator errors out.

Status in bash package in Ubuntu:
  New

Bug description:
  This snippet, taken from /etc/bash.bashrc, errors out on the here document, even though the 
  man page states that <<-EOF should allow for the terminating EOF to be indented.

  #!/bin/bash
  # sudo hint
  if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then
    case " $(groups) " in *\ admin\ *)
      if [ -x /usr/bin/sudo ]; then
        cat <<-EOF
          To run a command as administrator (user "root"), use "sudo <command>".
          See "man sudo_root" for details.
        EOF
      fi
    esac
  fi

  
  Error message is:
  ./test.sh: line 13: warning: here-document at line 6 delimited by end-of-file (wanted `EOF')
  ./test.sh: line 14: syntax error: unexpected end of file

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1715023/+subscriptions



More information about the foundations-bugs mailing list