Why is bash not behaving consistently?

Dan Track dan.track at gmail.com
Fri Aug 12 08:22:19 UTC 2005


Hi

I was writing this little bash script using find and I came along this
difference from using the same command on the command line and in bash
script.

Basically on the command line I have to type:

/usr/bin/find /opt/yum/packages/ -mtime +2 -a \( -regex .*.rpm -o
-regex .*.hdr \) -exec ls -lrt {} \;

whereas , in a bash script I have to type:

/usr/bin/find /opt/yum/packages/ -mtime +2 -a ( -regex .*.rpm -o
-regex .*.hdr ) -exec ls -lrt {} ;

As you can see I need to escape parenthesis and semi-colons on the
command line but I don't need to do that in a bash script.

Is there a reason for this?

Many Thanks
Dan




More information about the fedora-list mailing list