![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Writing the script | jess_t03 | Shell Programming and Scripting | 1 | 10-10-2007 02:17 AM |
| Startup script to clean out trash can | Andrek | OS X (Apple) | 4 | 10-19-2006 12:34 PM |
| clean up script | mpang_ | Shell Programming and Scripting | 1 | 07-17-2006 08:14 PM |
| What files are writing to a directory | hattorihanzo | UNIX for Dummies Questions & Answers | 3 | 01-17-2006 08:00 AM |
| Directory clean up | jango | AIX | 4 | 08-25-2004 06:00 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
writing script to clean up a directory
I have to do a directory clean up on several machines. The task is as follows:
go to a particular directory (cd /xxx) 1. create a directory ' SCRIPTCLEANUP ' ( i KNOW IT) loop through 2. List the directory 3. if directory and start with 'DQA' leave it, 4. if directory or file move it to the newly crated directory ( blanck directory delete) 5. It also requires to produce a report like this The directory contains xx unnecessary files and yy directory. The details are as follows: Directory Files endlook i started but not complete ssh to server cd /xxx mkdir scriptcleanup for i in * do if [ -f $i || -d (^DQA $i) ] mv $i ./scriptcleanup fi ech $ > report ( but i do not know how to insert in particular place like under Files or Directory section in the output file. ) done Note: I am working in ksh environment. Thanks in advance |
|||
| Google The UNIX and Linux Forums |
| Forum Sponsor | ||
|
|
| Thread Tools | |
| Display Modes | |
|
|