Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell differences between AIX & Solaris?

Status
Not open for further replies.

mnbhahn

MIS
Oct 30, 2004
3
US
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
 
Add the -depth option to your find statement.



Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top