On 8/12/05, Stephanus Fengler <fengler@xxxxxxxx> wrote: > Paul Howarth wrote: > > > Dan Track wrote: > > > >> 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? > > > > > > How are you running this script? I would expect the first version to > > work on the command-line and in a script, and the second version not > > to work at all... > > > > Paul. > > > Maybe your standard script interpreter isn't bash but simply sh? You may > add > # /bin/bash > > as your first line to make sure bash is used. > > Stephanus The script interpreter is /bin/bash. Thanks Dan