test for directory

Dave Ihnat dihnat at dminet.com
Tue Aug 18 13:43:56 UTC 2009


On Tue, Aug 18, 2009 at 06:41:30AM -0700, Yong Huang wrote:
> > Or, maybe less expensive:
> > 
> >   if [ \( -d /etc \) -a \( -d /home \) ]; then echo "Yes."; fi

> Can you explain why it's less expensive?

When you use a bracket, you're spawning a subshell.

Cheers,
--
	Dave Ihnat
	dihnat at dminet.com




More information about the redhat-list mailing list