79161994

Date: 2024-11-06 09:34:22
Score: 1.5
Natty:
Report link

remove indentation after opening EOF:

#!/bin/bash

create_file () {
    cat > a.txt <<EOF
0 abc def 
ghi jkl mno
pqrs tuv wxyz
EOF
}

create_file

Bash looks for the same "delimiter" that you started with. You started with "EOF", but was ending with "____EOF" when using indentation, so it couldn't match closing delimiter

Reasons:
  • Contains signature (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Den