Skip to content

Regression in goostats.sh after PR #1487 #1502

@olexandr-konovalov

Description

@olexandr-konovalov

The following happens in macOS Sequoia 15.6.1:

bash-5.1$ bash goostats.sh NENE01729A.txt stats-NENE01729A.txt
error reading input: NENE01729A.txt

I have traced this to the recently merged #1487 by @tkphd. The fix that works for me is to change from -a to -e or -f in

if [ ! -a "$1" ]
then
    echo "error reading input: $1"
    exit 2
elif [ -a "$2" ]
...

On this mac, bash man pages say that both -e and -a are True if file exists, and -f is True if file exists and is a regular file. Are there any specific reasons why -a was used and not, say, -f or -e?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions