pdf attachemnt


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting pdf attachemnt
# 1  
Old 09-02-2008
pdf attachemnt

Hi,
I have a script like below to attach a pdf file to the mail, but it is not working , could you please help.

# set -o verbose
FIRST=$(echo "$1" | awk -F. '{print $1}')
# LAST=$(echo "$1" | awk -F_ '{print $2}')
# LAST="${LAST}.pdf"
NEW="${FIRST}_new.pdf"
FINAL="${FIRST}_final.pdf"
RPTID=$(echo $RPT_NAME | awk -F/ '{print $NF}')
RPTID=$(echo $RPTID | awk -F. '{print $1}')
/bin/uuencode $1 $NEW > $FINAL
/bin/mailx $2 <<EOF
~s LI Report $RPTID
~r $FINAL
~.


Thanks
# 2  
Old 09-02-2008
Don't see RPT_NAME defined/declared anywhere...
# 3  
Old 09-02-2008
This doesnt use mailx but its what I use.


Here is the script i use:

just call sh sctipt.sh /path/to/filename


Code:
#!/bin/bash
ATTFILE=$1
ATTNAME=$1
MAILTO=someone@somewhere.com
MAILFROM=someoneelse@somewhere.com

( cat <<HERE; uuencode "${ATTFILE}" "${ATTNAME}" ) | sendmail -oi -t
From: ${MAILFROM}
To: ${MAILTO}
Subject: Subject Here attached $ATTNAME

HERE

# 4  
Old 09-02-2008
Or try this:

FIRST=$(echo "$1" | awk -F. '{print $1}')
FINAL="${FIRST}_final.pdf"
uuencode "$1" "${FINAL}" | mailx -s "PDF Report" test@example.com
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pdf to text

Is there a way using the pdf to text utility to convert all the pdf in a given directory? So instead of one at a time: pdftotext pdftotext hp-manual.pdf hp-manual.txt a directory of 50 pdf files would be converted: pdftotext /home/dnascopev/Desktop/PDF.pdf /home/dnascopev/Desktop/PDF.txt ... (6 Replies)
Discussion started by: cmccabe
6 Replies

2. Shell Programming and Scripting

Converting secured pdf files to pdf using acroread

Does anybody have idea of Converting secured pdf files to pdf using acroread ? ---------- Post updated at 04:49 PM ---------- Previous update was at 04:44 PM ---------- This file is not password protected. (4 Replies)
Discussion started by: Soham
4 Replies

3. Shell Programming and Scripting

PDF Script to extract PDF Links MOD in Need

In here we have a script to extract all pdf links from a single page.. any idea's in how make this read instead of a page a list of pages.. and extract all pdf links ? #!/bin/bash # NAME: pdflinkextractor # AUTHOR: Glutanimate (http://askubuntu.com/users/81372/), 2013 #... (1 Reply)
Discussion started by: danielldf
1 Replies

4. Shell Programming and Scripting

Perl - Convert html to pdf - PDF::FromHTML

Hi, I am trying to convert html to pdf using perl module PDF::FromHTML, am getting the error as given below. not well-formed (invalid token) at line 2, column 17, byte 56 at C:/Perl/lib/XML/Parser.pm line 187 at C:/Perl/site/lib/PDF/FromHTML.pm line 140 The perl code is as given... (2 Replies)
Discussion started by: DILEEP410
2 Replies

5. AIX

pdf reader

which package is to be installed to view pdf files in AIX machine? i already have xpdf version 1...but, some pdf files are not opening in it.help me out. (1 Reply)
Discussion started by: me.kamph
1 Replies

6. HP-UX

Hp ux 11.0 version pdf

Hi all, plz provide anu link or document for hp ux command or pdf avaiblable? serched but no productive info ??:( (1 Reply)
Discussion started by: saurabh84g
1 Replies

7. UNIX for Dummies Questions & Answers

PDF Printing....

:confused: We have a Sco Open Unix 5.0.5 Server that I am trying to configure to allow for PDF creation. Currently the server is just using lpr to print to laser printers located throughout the facility. The goal is to be able to also print to pdf documents. There is no option for... (2 Replies)
Discussion started by: pabloescobar
2 Replies

8. UNIX for Dummies Questions & Answers

Report to PDF

Hi their, I am trying to find out if there is a way that when a report is generated it can be converted to a PDF or generated as a PFD. :D (5 Replies)
Discussion started by: Croney69
5 Replies

9. UNIX Desktop Questions & Answers

PDF to PCL

hi all, i would like to know if there are any tools in unix (sun solaris 8) to convert PDF files to PCL format (i.e, .prn files) i want to convert around 3000 files (in a batch) to PCL format files. can anyone help me out with this. regards, manojram (1 Reply)
Discussion started by: manojram
1 Replies
Login or Register to Ask a Question