10-30-2012
Boy, I've avoided scripting because it's a whole other language to learn. I barely have a grasp on the command line. But you guys have tossed me into the deep end - I may as well learn to swim.
Two things occur to me:
1.) Possibly, I have malformed, (if that's the word), text files. It is likely they were created on a Windows machine, so I will check that out, and convert them if necessary. Perhaps that is the problem? Then, I think I have a way to test whether each file ends in a newline.
2.) Forgive my ignorance, but are the variables defined correctly? How does the script know, for instance, that "ot" equals "./01_Old Testament"?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi there,
I have numerous files in a directory (approx 2500) that I want to delete although I get the following:-
Server> rm *.*
Arguments too long
Is there a proper way of deleting this rather than breaking it down further through the list of files
rm *10.*
rm *11.*
rm *12.*
... (10 Replies)
Discussion started by: Hayez
10 Replies
2. UNIX for Dummies Questions & Answers
Hi, I'm totally new to Unix. I'm an MVS mainframer but ran into a situation where a Unix server I have available will help me. I want to be able to remotely connect to another server using FTP, login and MGET all files from it's root or home directory, logout, then login as a different user and do... (1 Reply)
Discussion started by: s80bob
1 Replies
3. Shell Programming and Scripting
I need a script to concatenate several files in one step, I have 3 header files say file.S, file.X and file.R, I need to concatenate these 3 header files to data files, say file1.S, file1.R, file1.X so that the header file "file.S" will be concatenated to all data files with .S extentions and so on... (3 Replies)
Discussion started by: docaia
3 Replies
4. Shell Programming and Scripting
I have 2 files
FILEA
1232342
1232342
2344767
4576823
2325642
FILEB
3472328
2347248
1237123
1232344
8787890
I want the output to go into a 3rd file and look like:
FILEC
1232342 3472328 (1 Reply)
Discussion started by: unxusr123
1 Replies
5. Shell Programming and Scripting
I have directory structure sales_only under which i have multiple directories for each dealer
example:
../../../Sales_Only/xxx_Dealer
../../../Sales_Only/yyy_Dealer
../../../Sales_Only/zzz_Dealer
Every day i have one file produce under each directory when the process runs.
The requirement... (3 Replies)
Discussion started by: mohanmuthu
3 Replies
6. Shell Programming and Scripting
Hi, I want to create a batch(bash) file to combine 23 files together. These files have the same extension. I want the final file is save to a given folder. Once it is done it will delete the 23 files.
Thanks for help. Need script. (6 Replies)
Discussion started by: zhshqzyc
6 Replies
7. Shell Programming and Scripting
I have a file named "file1" which has the following data
10000
20000
30000
And I have a file named "file2" which has the following data
ABC
DEF
XYZ
My output should be
10000ABC
20000DEF (3 Replies)
Discussion started by: bobby1015
3 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
Need your help.
I will need to concatenate around 100 files but each end of the file I will need to insert my name DIRT1228 on each of the file and before the next file is added and arrived with just one file for all the 100files.
Appreciate your time.
Dirt (6 Replies)
Discussion started by: dirt1228
6 Replies
9. UNIX for Dummies Questions & Answers
Hi
I am trying to learn linux step by step an i am wondering
can i use cat command for concatenate files but i want to place context of file1 to a specific position in file2 place of file 2 and not at the end as it dose on default?
Thank you. (3 Replies)
Discussion started by: iliya24
3 Replies
10. UNIX for Dummies Questions & Answers
- Concatenate files and delete source files. Also have to add a comment.
- I need to concatenate 3 files which have the same characters in the beginning and have to remove those files and add a comment and the end.
Example:
cat REJ_FILE_ABC.txt REJ_FILE_XYZ.txt REJ_FILE_PQR.txt >... (0 Replies)
Discussion started by: eskay
0 Replies
LEARN ABOUT CENTOS
mail::spamassassin::client
Mail::SpamAssassin::Client(3) User Contributed Perl Documentation Mail::SpamAssassin::Client(3)
NAME
Mail::SpamAssassin::Client - Client for spamd Protocol
SYNOPSIS
my $client = new Mail::SpamAssassin::Client({
port => 783,
host => 'localhost',
username => 'someuser'});
or
my $client = new Mail::SpamAssassin::Client({
socketpath => '/path/to/socket',
username => 'someuser'});
Optionally takes timeout, which is applied to IO::Socket for the
initial connection. If not supplied, it defaults to 30 seconds.
if ($client->ping()) {
print "Ping is ok
";
}
my $result = $client->process($testmsg);
if ($result->{isspam} eq 'True') {
do something with spam message here
}
DESCRIPTION
Mail::SpamAssassin::Client is a module which provides a perl implementation of the spamd protocol.
PUBLIC METHODS
new
public class (Mail::SpamAssassin::Client) new (\% $args)
Description: This method creates a new Mail::SpamAssassin::Client object.
process
public instance (\%) process (String $msg)
Description: This method calls the spamd server with the PROCESS command.
The return value is a hash reference containing several pieces of information, if available:
content_length
isspam
score
threshold
message
check
public instance (\%) check (String $msg)
Description: The method implements the check call.
See the process method for the return value.
headers
public instance (\%) headers (String $msg)
Description: This method implements the headers call.
See the process method for the return value.
learn
public instance (Boolean) learn (String $msg, Integer $learntype)
Description: This method implements the learn call. $learntype should be an integer, 0 for spam, 1 for ham and 2 for forget. The return
value is a boolean indicating if the message was learned or not.
An undef return value indicates that there was an error and you should check the resp_code/resp_msg values to determine what the error was.
report
public instance (Boolean) report (String $msg)
Description: This method provides the report interface to spamd.
revoke
public instance (Boolean) revoke (String $msg)
Description: This method provides the revoke interface to spamd.
ping
public instance (Boolean) ping ()
Description: This method performs a server ping and returns 0 or 1 depending on if the server responded correctly.
PRIVATE METHODS
_create_connection
private instance (IO::Socket) _create_connection ()
Description: This method sets up a proper IO::Socket connection based on the arguments used when creating the client object.
On failure, it sets an internal error code and returns undef.
_parse_response_line
private instance (@) _parse_response_line (String $line)
Description: This method parses the initial response line/header from the server and returns its parts.
We have this as a separate method in case we ever decide to get fancy with the response line.
_clear_errors
private instance () _clear_errors ()
Description: This method clears out any current errors.
_filter
private instance (\%) _filter (String $msg, String $command)
Description: Makes the actual call to the spamd server for the various filter method (ie PROCESS, CHECK, HEADERS, etc). The command that
is passed in is sent to the spamd server.
The return value is a hash reference containing several pieces of information, if available:
content_length
isspam
score
threshold
message (if available)
perl v5.16.3 2011-06-06 Mail::SpamAssassin::Client(3)