help with a bash script please

Garrett Klein garrettklein at comcast.net
Sat Apr 8 18:39:41 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Greg,

	What you're looking for is
if [ !-r filename ]; then
#commands here;
fi

HTH,
Garrett

On Sat, Apr 08, 2006 at 03:16:56PM -0700, Gregory Nowak wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi all.
> 
> I'm having trouble with an if statement in a bash script I'm
> writing. What I want to do, is to check if a file doesn't have read
> permission. What I'm doing is:
> 
> if !([ -r filename])
> 
> However, bash says that the command [-r is not found on line
> number. Can someone please tell me what I'm doing wrong, and show me
> how to do what I want to do properly? Thanks in advance.
> 
> Greg
> 
> 
> - -- 
> web site: http://www.romuald.net.eu.org
> gpg public key: http://www.romuald.net.eu.org/pubkey.asc
> skype: gregn1
> (authorization required, add me to your contacts list first)
> 
> - --
> Free domains: http://www.eu.org/ or mail dns-manager at EU.org
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> 
> iD8DBQFEODZY7s9z/XlyUyARAgVJAKCyow1QR5lo7DjsNxUfAavCO86gFQCgmC+i
> S58rlWJzeICulyaj9sKfono=
> =QG4s
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iQIVAwUBRDg7rfQ3GgYHRr/HAQKv4A/+N0D2A7fSOgT0naxv05LQpWTfLLJAM8RE
rORVunmgcrY+uKCnP0KIOBYGQz4PgHtqd5TMqO8NNIUBvvHQkOMMEmU0FpTuYhTI
4XuTjQZGSKbD4DhCNoIadi+56+9rjdWhsdiI4wtlrpYgWLoKdHRmuqEPgcS3yy8S
BnlcXWbKHFH+/iypxd4li17dFem3XHKoB3nlIqMl6nIqLIFlJXPSjMlIXJpgfLXF
PN4vhTy3+dVClxz5ShPAAIwxHZjcNLb8h3usCnKQS0dNY3+Zxrv1TM/3f5pTHsm1
xFKWe89U+1HUrzox86ivIDfiUl2/UDxroYKksPYbPfIt2qFDJRUu5TS9+vOYHvsn
GpCQ8xC8/DJLP24MWH+0P0uHSkFt/rtm38sLIDm4DIEJrm73KLvkQCG6anps41FS
boOt4g/5nsKhy2HV0VFI7ZwpZinTzDk2+eH3X82PQs7EsZXoHzdOyS/q+yKXQZlZ
xZ+Z7AW8PasmDNa4q+K/ZpNI0Nf9KsmFZ6ltUUr2jt967zmb5EFMMhXv62ot5TBe
RY/yGFm6VCU18VRfwqIglc6/3tFpMVh/WNMLevJL5AX7UN6dn6r94NDKgnzs8EUI
nCnB7eU6u7EeC0ocvHjCtCvwRsLwDwPvo0RR1lMTXG6Q4f5+WtD/qy0BATYNerhw
UiSE/mEnEj8=
=0Vdh
-----END PGP SIGNATURE-----




More information about the Speakup mailing list