[last updated - 28 July 2003]
This is the mean cousin of the delsome utility for optionally deleting files out of a presented list. It issues deletes for all the files and does not bother asking the user.
There is not much to learn here except for the way the do-it-now quotes are placed around a print statement that puts out the text to delete the files. The do-it-now quotes turn the text into something that is actually done.
#!/bin/sh # Script : delall # Version : 1.0 # Author : Roland Rashleigh-Berry # Date : 28 July 2003 # Contact : roland@rashleigh-berry.fsnet.co.uk # Purpose : To delete a list of files # SubScripts : none # Notes : THIS UTILITY MUST BE PIPED INTO with a list of files to delete. # Usage : ls *.log | delall # #================================================================================ # PARAMETERS: #-pos- -------------------------------description-------------------------------- # N/A none (must be piped into) #================================================================================ # AMENDMENT HISTORY: # init --date-- mod-id ----------------------description------------------------- # #================================================================================ # This is public domain software. No guarantee as to suitability or accuracy is # given or implied. User uses this code entirely at their own risk. #================================================================================ `awk '{print "rm -f", $0}'`
Go back to the home page.
E-mail the macro and web site author.