09-17-2012
Script to remove line by line
Say I have an email with its message source. What I am trying to achieve is to run an anti-spam scan to determine which line in the message triggers the anti-spam program. The line that triggers the anti-spam program will produce an output of "Spam".
So, how can I write a script that will take out the last line, test the whole message, and then remove the last and 2nd last line, re-test the whole message, and the process will carry on until it returns the line that is spam.
Thanks heaps.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need some help in removing the header (first line) and the trailer (last line) in a give file...
The data file actually comes in EBCDIC format and I converted it into ASCII..
Now I need to strip off the first line and the last line..
I think we can use sed to do something like this:... (2 Replies)
Discussion started by: madhunk
2 Replies
2. Shell Programming and Scripting
Aloha! I have just over 1k of users that have permissions that they shouldn't under our system. I need to parse a provided list of usernames, check their permissions file, and strip the permissions that they are not allowed to have. If upon the permissions strip they are left with no permissions,... (6 Replies)
Discussion started by: Malumake
6 Replies
3. Shell Programming and Scripting
hello experts,
I need a sed command that remove last 10 characters of a line start from 3rd line.
any suggestions?
Thanks you (7 Replies)
Discussion started by: minifish
7 Replies
4. Shell Programming and Scripting
Hi Folks,
I am new to ksh, i have informatica parameter file that i need to update everyday with shell script. i need your help updating this file with new parameters.
sample data
$$TABLE1_DATE=04-27-2011
$$TABLE2_DATE=04-23-2011
$$TABLE3_DATE=03-19-2011
.......Highligned... (4 Replies)
Discussion started by: victor369
4 Replies
5. UNIX for Dummies Questions & Answers
Hello everyone,
This is my first posting. I have read the rules of this forum. I have searched many various threads and haven't found one that applies to my situation or suggestions to fix the issue. I do appreciate the help.
I am trying to execute a basic UNIX script in a Solaris... (4 Replies)
Discussion started by: dqrgk0
4 Replies
6. Shell Programming and Scripting
Hi! I have been struggling with a large file that has stray end of line characters.
I am working on a Mac (Lion). I mention this only because I have been mucking around with fixing my problem using sed, and I have learned far more than I wanted to know about Unix and Mac eol characters.
I... (1 Reply)
Discussion started by: user999991
1 Replies
7. UNIX for Dummies Questions & Answers
awk 'BEGIN{FS = "Ç"}
NR == 1 {p = $0; next}
NF > 1 {print p; p = $0}
NF <= 1 {p = (p " " $0)}
END {print p}' input.txt > output.txt
This is what the input data file looks like with broken lines
Code:
29863 Ç890000000 Ç543209911 ÇCHNGOHG
Ç000000001 Ç055 ... (4 Replies)
Discussion started by: cumeh1624
4 Replies
8. Shell Programming and Scripting
I have a test file with the following format, It contains the username_date when the user was locked from the database.
$ cat lockedusers.txt
TEST1_21062016
TEST2_02122015
TEST3_01032016
TEST4_01042016
I'm writing a ksh script and faced with this difficult scenario for my... (11 Replies)
Discussion started by: humble_learner
11 Replies
9. Shell Programming and Scripting
Hi,
i have a file with multiple entries. After some tests with sed i managed to get the file output as follows:
lsn=X-LINK-IN0,apc=661:0,state=avail,avail/links=1/1,
00,2110597,2094790,0,81,529,75649011,56435363,
lsn=TM1ITP1-AM1ITP1-LS,apc=500:0,state=avail,avail/links=1/1,... (5 Replies)
Discussion started by: nms
5 Replies
LEARN ABOUT SUSE
mail::spamassassin::plugin::spamcop
Mail::SpamAssassin::Plugin::SpamCop(3) User Contributed Perl Documentation Mail::SpamAssassin::Plugin::SpamCop(3)
NAME
Mail::SpamAssassin::Plugin::SpamCop - perform SpamCop reporting of messages
SYNOPSIS
loadplugin Mail::SpamAssassin::Plugin::SpamCop
DESCRIPTION
SpamCop is a service for reporting spam. SpamCop determines the origin of unwanted email and reports it to the relevant Internet service
providers. By reporting spam, you have a positive impact on the problem. Reporting unsolicited email also helps feed spam filtering
systems, including, but not limited to, the SpamCop blacklist used in SpamAssassin as a DNSBL.
Note that spam reports sent by this plugin to SpamCop each include the entire spam message.
See http://www.spamcop.net/ for more information about SpamCop.
USER OPTIONS
spamcop_from_address add@ress.com (default: none)
This address is used during manual reports to SpamCop as the From: address. You can use your normal email address. If this is not
set, a guess will be used as the From: address in SpamCop reports.
spamcop_to_address add@ress.com (default: generic reporting address)
Your customized SpamCop report submission address. You need to obtain this address by registering at "http://www.spamcop.net/". If
this is not set, SpamCop reports will go to a generic reporting address for SpamAssassin users and your reports will probably have less
weight in the SpamCop system.
spamcop_max_report_size (default: 50)
Messages larger than this size (in kilobytes) will be truncated in report messages sent to SpamCop. The default setting is the maximum
size that SpamCop will accept at the time of release.
perl v5.12.1 2010-03-16 Mail::SpamAssassin::Plugin::SpamCop(3)