🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1858

Re: Question about 'test' (Was Re: testing if a file is present)

#1858
From: Guy Harris
Date: Thu, 29 Nov 1990 19:04
11 lines
988 bytes
>But what will the (bourne-) shell say about...
>>
>>        if [ -r filename ]; then

It'll say "OK, this 'if' is going to run the command named '[', passing
it '-r' as its first argument, 'filename' as its second argument, and
']' as its third argument."

"test"/"[" will then say "well, I was invoked as '[' rather than 'test';
that means I should check to make sure my last argument is ']', and
complain otherwise."
Technical Details
Message-ID: <4586@auspex.auspex.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!cs.utexas.edu!helios!bcm!dimacs.rutgers.edu!seismo!uunet!auspex!guy
References: <ger.659126250@prisma> <1990Nov21.191638.19469@athena.mit.edu> <90326.175421PPH93@DMSWWU1A.BITNET>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!cs.utexas.edu!helios!bcm!dimacs.rutgers.edu!seismo!uunet!auspex!guy
From: guy@auspex.auspex.com (Guy Harris)
Newsgroups: comp.unix.shell
Subject: Re: Question about 'test' (Was Re: testing if a file is present)
Message-ID: <4586@auspex.auspex.com>
Date: 29 Nov 90 19:04:36 GMT
References: <ger.659126250@prisma> <1990Nov21.191638.19469@athena.mit.edu> <90326.175421PPH93@DMSWWU1A.BITNET>
Organization: Auspex Systems, Santa Clara
Lines: 11