$theScript ="temp.exp"; $cd = "cd ../../logs/tu/tull"; $cmd = "expect -f '$theScript' '$cd' pwd 'find . -name '*.std*' -o -name 'ULOG.*' -mtime + 9 -type f -exec rm {} \\;' pwd"; print "$cmd\n"; system($cmd);