Sending Multipes files as attachents in directory


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 5 Days Ago
Sending Multipes files as attachents in directory

When i run the below command in Unix it works

Code:
echo|mailx -s "Subject"   $( printf -- '-a %q ' /Directory/*.* )  mail_address < /directory/mail_body.txt


But when the same command is run in AIX Platform I get invalid -a error.


Could you please help on this


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 5 Days Ago at 11:25 AM.. Reason: Added CODE tags.
# 2  
Old 5 Days Ago
What Unix? What shell?

What does man mailx say on either system?

Last edited by RudiC; 5 Days Ago at 11:51 AM..
# 3  
Old 5 Days Ago
we dont have the option for -a on on the platforms in the man for mailx.

Do we have any workaround to send multiples files in a directorty :

I have tried below but it doesnt attach files

Code:
(
   for i in /dir/*.*
   do 
      uuencode "$i" $(basename "$i") ;  
   done
) | mailx -s "Subject" mail_addrr < /dir/Mail_Body.txt


Code:
Flags

       Flags Description
       Item
            Description
       -c Address(es)
            Specifies the list of users to which a copy of the message is sent. You can specify one or more addresses. When specifying more than one address, the list of addresses must be in (" ") quotes.
       -d
            Specifies the debug information associated with the users mailbox
              *    uid
              *    user name
              *    mail file folder (the system mailbox)
              *    dead letter (the system saves incomplete messages in the dead.letter file in the $HOME
              *    mbox  (the personal mailbox)
            Note: The message is not sent when the program is in the debug mode.
       -e
            Tests for the presence of mail in the system mailbox. The mail utility will write nothing and exit with a successful return code if there is mail to read.
       -f FileName
            Reads messages from the named file. If a file operand is not specified, then reads messages from mbox. When you quit from reading the messages, undeleted messages are written back to this file.

Code:
The following options are accepted:

       -A name
              Executes an account command (see below) for name after the startup files have been read.

       -a file
              Attach the given file to the message.

       -B     Make standard input and standard output line-buffered.

       -b address
              Send blind carbon copies to list.  List should be a comma-separated list of names.

       -c address
              Send carbon copies to list of users.

       -D     Start in disconnected mode; see the description for the disconnected variable option.

       -d     Enables debugging messages and disables the actual delivery of messages.  Unlike -v, this option is intended for mailx development only.

       -e     Just check if mail is present in the system mailbox.  If yes, return an exit status of zero, else, a non-zero value.

       -E     If  an  outgoing message does not contain any text in its first or only message part, do not send it but discard it silently, effectively setting the skipemptybody variable at program startup.  This
              is useful for sending messages from scripts started by cron(8).

       -f [file]
              Read in the contents of the user's mbox (or the specified file) for processing; when mailx is quit, it writes undeleted messages back to this file.  The string file is handled as described  for  the
              folder command below.


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 5 Days Ago at 12:03 PM.. Reason: Added CODE tags.
# 5  
Old 5 Days Ago
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Directory containing files,Print names of the files in the directory that are exactly same content. anuragpgtgerman Shell Programming and Scripting 7 03-23-2017 08:58 AM
List files with date, create directory, move to the created directory charli1 Shell Programming and Scripting 6 01-26-2016 02:00 PM
Searching for files and sending mail cratercrabs Shell Programming and Scripting 2 02-13-2013 01:33 AM
Help comparing 2 files and sending differences jabbott3 Shell Programming and Scripting 4 01-09-2013 10:30 AM
GFORTRAN sending .o files in separate directory kristinu Programming 1 11-12-2012 05:54 PM
Grepping file names, comparing them to a directory of files, and moving them into a new directory sHockz Shell Programming and Scripting 1 02-02-2012 01:53 AM
Sending email with multiple files.. msrahman Shell Programming and Scripting 30 11-03-2010 01:58 PM
script to monitor files in a directory and sending the alert shellscripter Shell Programming and Scripting 0 11-26-2008 01:26 AM
Sending text files as attachments radhika03 Shell Programming and Scripting 2 06-07-2007 10:17 AM
Sending an email with more than one files thambi Shell Programming and Scripting 7 05-25-2007 09:52 PM
sending larger files via ftp matrixmadhan UNIX for Advanced & Expert Users 6 05-24-2006 10:50 AM
Sending Multiple Files through email nbvcxzdz Shell Programming and Scripting 4 03-29-2005 08:49 AM
sending files as attachments SmartJuniorUnix How do I send email? 9 04-13-2001 07:34 AM
sending files as attachments SmartJuniorUnix UNIX for Dummies Questions & Answers 9 04-13-2001 07:34 AM