Hi ! I am new to Unix, so i need ur help ... thanks !
I use ksh shell script in HP-UX environment.
I have to write a script which do 3 things:
1. select some file from a directory
2. tar all these files into a file ( *.tar)
3. remove the file from the directory
The files which i look for are mails in Proc directory.
I have wrote the script but it didn't work, may i know what's wrong ?
#!/usr/bin/sh
AGE=1
DT='yesterday -$AGE | cut -c 4-5,1-2'
echo $DT
find ./m* -mtime +1 -print | tar -cvf mail.$(yesterday).tar | rm -f/mail/proc/m* [sig][/sig]
I use ksh shell script in HP-UX environment.
I have to write a script which do 3 things:
1. select some file from a directory
2. tar all these files into a file ( *.tar)
3. remove the file from the directory
The files which i look for are mails in Proc directory.
I have wrote the script but it didn't work, may i know what's wrong ?
#!/usr/bin/sh
AGE=1
DT='yesterday -$AGE | cut -c 4-5,1-2'
echo $DT
find ./m* -mtime +1 -print | tar -cvf mail.$(yesterday).tar | rm -f/mail/proc/m* [sig][/sig]