[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: -bash: [: : integer expression expected
From: |
Greg Wooledge |
Subject: |
Re: -bash: [: : integer expression expected |
Date: |
Sat, 4 Mar 2023 11:30:11 -0500 |
On Sat, Mar 04, 2023 at 08:26:18AM -0800, write2mark1@gmail.com wrote:
> >
> > keep getting this error on this line
>
> if [ "$( wc -l <"$pathname" )" -eq 1 ]; then
> -bash: [: : integer expression expected
>
> pls help
unicorn:~$ [ "$(wc -l < nosuchfile)" -eq 1 ]
bash: nosuchfile: No such file or directory
bash: [: : integer expression expected
It sounds like your pathname variable is empty, or contains a string
which is not a filename relative to the script's working directory.