Try:
If that correctly lists the rm commands you want to run, change the last line of the script to:
to execute the commands instead of just printing them.
With your sample list of files, it produces the output:
If you want to try this on a Solaris/SunOS system, change awk to /usr/xpg4/bin/awk, /usr/xpg6/bin/awk, or nawk.
This User Gave Thanks to Don Cragun For This Post:
i have a directory "ABC" with lots of old files and sub directories in it.
the issue now is i want to delete away files which are older than 15 days in "ABC" without deleting the files in the sub directories and without deleting the sub directory.
i tried using find command but it will drill down... (2 Replies)
Hi all,
Lets say I have 3 files a.txt and b.txt and c.txt.
a.txt has the following text
====================
apple is good for health
b.txt has the following text
====================
apple is pomme in french
c.txt has the following text
====================
orange has citric acid... (1 Reply)
Hello,
I have these files in my directory.
ABC123 ABC12.sls.20080809111121
ABC233 ABC12.sls.20080403123212
ABC543 ABC12.sls.20080804231212
ABC323 ABC12.sls.20080809111232
ABC765 ABC12.sls.20080809112343
ABC654 ABC12.sls.20080809113133
I want to delete only files in first... (2 Replies)
Hello,
I have several files in a specific directory.
A specific string in one file can occur in another files.
If this string is in other files. Then all the files in which this string occured should be deleted and only 1 file should remain with the string.
Example.
file1
ShortName "Blue... (2 Replies)
Hi Everyone,
I am looking for a simple way for replacing all the files under a directory that use the server "xsgd1234dap" with "xsdr3423pap".
For Example:
In the Directory,
$pwd
/home/nick
$ grep -l "xsgd1234dap" *.sh | wc -l
119
I have "119" files that are still using... (5 Replies)
grep -c 'avihai' 1.log
will give me count of 'avihai' in log
I want to have a list of files in the folder that show file name with count side by side.
Please advice (2 Replies)
I'm sure this has been asked many times, but a search didn't turn up a definitive best method for this (if there ever is such a thing).
I have been using rsync to back up my main data directory, but I have accumulated a large number of older backups that I don't need. All of the files I don't... (14 Replies)
Hi
My directory structure is as below.
dir1, dir2, dir3
I have the list of files to be deleted in the below path as below.
/staging/retain_for_2years/Cleanup/log $ ls -lrt
total 0
drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2
drwxr-xr-x 2 root ... (2 Replies)
can anyone tell me what is the commands to delete the below particular word in the all files located in one particular file path
files/ll>grep "/ftp/" test.kell
ftp -m uskmc -d /ftp/ -i filename.zip
output should be :
ftp -m uskmc -d -i filename.zip (4 Replies)
hi,
i have a requirement to delete all the files from all the directories except some specific directories like archive and log.
for example:
there are following directories such as
A B C D Archive E Log F
which contains some sub directories and files. The requirement is to delete all the... (7 Replies)
Discussion started by: Little
7 Replies
LEARN ABOUT SUSE
igawk
IGAWK(1) Utility Commands IGAWK(1)NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
Free Software Foundation Nov 3 1999 IGAWK(1)