Is anyone aware of shell differences between AIX and Solaris. There is either a differnce in the shell or the "find" command.
For example on Solaris...
# find /tmp/findtst -type d -mtime +30 -exec rm -r {} \;
# echo $?
0
On AIX ...
# find: 0652-081 cannot change directory to </tmp/findtst/tst>: A file or directory in the path name does not exist.
# echo $?
1
Any ideas?
Mike
PS - Here is a sample script that demonstrates the problem...
#!/bin/ksh
tmpdir=/tmp/findtst
mkdir $tmpdir
cd $tmpdir
mkdir -p ./tst
touch ./tst/abcfile
touch 1101000004 ./tst # back-date the directory to Nov 2004.
cd -
ls -ld $tmpdir/tst
ls -ld $tmpdir/tst/*
find $tmpdir -type d -mtime +30
echo " "
echo find status=$?
find $tmpdir -type d -mtime +30 -exec rm -r {} \;
echo findrm status=$?
# Cleanup
rm -rf $tmpdir
exit 0
For example on Solaris...
# find /tmp/findtst -type d -mtime +30 -exec rm -r {} \;
# echo $?
0
On AIX ...
# find: 0652-081 cannot change directory to </tmp/findtst/tst>: A file or directory in the path name does not exist.
# echo $?
1
Any ideas?
Mike
PS - Here is a sample script that demonstrates the problem...
#!/bin/ksh
tmpdir=/tmp/findtst
mkdir $tmpdir
cd $tmpdir
mkdir -p ./tst
touch ./tst/abcfile
touch 1101000004 ./tst # back-date the directory to Nov 2004.
cd -
ls -ld $tmpdir/tst
ls -ld $tmpdir/tst/*
find $tmpdir -type d -mtime +30
echo " "
echo find status=$?
find $tmpdir -type d -mtime +30 -exec rm -r {} \;
echo findrm status=$?
# Cleanup
rm -rf $tmpdir
exit 0