Why is bash not behaving consistently?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux