![]() | 1 | initial version |
In the error message you quoted you have
./acctchk.sh: line 7: [-f: command not found
I notice a missing space between [
and -f
. That space is essential as it separates the command [
from its first argument -f
. The '[' command, by the way, is the same as the test
command.
In your script, however, I see
if [ -f /root/passwd.ar ]
This could also be written
if test -f /root/passwd.ar
It it will do exactly the same thing.
which looks correct.
![]() | 2 | No.2 Revision |
In the error message you quoted you have
./acctchk.sh: line 7: [-f: command not found
I notice a missing space between [
and -f
. That space is essential as it separates the command [
from its first argument -f
. The '[' [
command, by the way, is the same as the test
command.
In your script, however, I see
if [ -f /root/passwd.ar ]
This could also be written
if test -f /root/passwd.ar
It it will do exactly the same thing.
which looks correct.