Sponsored Content
Full Discussion: ~c carbon copy in HP-UX
Top Forums Shell Programming and Scripting ~c carbon copy in HP-UX Post 302835383 by krupasindhu18 on Monday 22nd of July 2013 09:52:50 AM
Old 07-22-2013
~c carbon copy in HP-UX

see the below i am getting but mail is not sending ...

mailx ~c krupa@aol.com -s Hi - This is mail subject /projects/psoft/hrdw/pushreports/test/to_maillist


when i am doing cat ,i cound see below contain and I am sure there is only behera@aol.com email is is there .
but how it is appending some garbage at the time of send mail.
cat /projects/psoft/hrdw/pushreports/test/to_maillist

behera@aol.com
From hrdw Mon Jul 22 09:41:28 2013
To: ~c krupa@aol.com -s Hi - This is mail subject /projects/psoft/hrdw/pushreports/test/to_maillist

4 0000021 DTA 26-MAR-2012 DTA

I am sure my script is working properly except mailing part
I am attaching my shell script.please check and please let me know what is the necessary change can be done .

HTML Code:
#!/bin/sh
set -vx
mail_body=/projects/psoft/hrdw/pushreports/test
rm -rf $mail_body/temp
v1=/projects/psoft/hrdw/pushreports/test/kkk.txt
echo "$v1"
while read p1
do
echo "$p1"
if [ "$p1" = 'LLLLLLLLLL' ]
then
cnt=`cat $mail_body/temp | wc -l`
echo "1st count $cnt"
tail -`expr $cnt - 3` $mail_body/temp >$mail_body/tail_2.txt
cnt=`cat $mail_body/tail_2.txt | wc -l`
echo "2nd count $cnt"
head -`expr $cnt - 2` $mail_body/tail_2.txt >$mail_body/temp_body

cnt=`cat $mail_body/tail_2.txt | wc -l`
echo "3rd count for cc_mail list $cnt"

tail -n -2 $mail_body/tail_2.txt >$mail_body/cc1_maillist

sed -n '1p' cc1_maillist > $mail_body/to_maillist

echo "cc_mail list :`cat $mail_body/to_maillist`"
sed -n '2,$p' cc1_maillist >$mail_body/cc_maillist

echo "to_mail list :`cat $mail_body/cc_maillist`"

if [ -s $mail_body/cc_maillist ]
then
echo "CC_mail list exists and sending mail with CC List"
cat $mail_body/temp_body| mailx ~c $(cat $mail_body/cc_maillist | sed -e 's/ / \~c /g') -s "Hi - This is mail subject" $mail_body/to_maillist
else
echo "CC_mail list doesn't exists and sending mail onlt to List"
cat $mail_body/temp_body| mailx -s "Hi - This is mail subject" $mail_body/to_maillist
fi
rm -rf $mail_body/temp
rm -rf $mail_body/tail_2.txt
rm -rf $mail_body/temp_body
else
echo "$p1" >>$mail_body/temp
fi
done <"$v1"
 

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Carbon Copy to exchange user

Hello, I am trying to send a message to few users on an exchange server. I would like to put few of them as CC. When I send it to myself and CC another user, I receive the e-mail and see the other e-mail address under CC but he doesn't receive the e-mail at all. Any ideas ? I am using... (1 Reply)
Discussion started by: mclevy
1 Replies

2. UNIX for Advanced & Expert Users

Problem with Carbon copy (CC) option in mailx command

Hi, I have problems with the cc option in mailx command. Just went through some of the similar threads but none provides a satisfactory explanation. I have a script using the mailx command in the following way: (echo `cat mailsub.txt` ; uuencode attachment.csv attachment.csv) | mailx -s... (2 Replies)
Discussion started by: SmithaN
2 Replies

3. Shell Programming and Scripting

Carbon copy for a mail in mailx command

Hi, Can you please anyone say how to send a mail with carbon copy using the mailx command. i.e the recipient list should be in CC while the mail reaches them. I need the option mailx command Thanks in advance. (11 Replies)
Discussion started by: miltony
11 Replies

4. OS X (Apple)

system() in carbon & FTP

Hey, I'm trying to establish a connection to FTP in carbon using the system() function, but I'm not sure how to supply my FTP password in the same command. For example, I have: system("ftp myusername@mydomain.net"); It then obviously prompts for the password, so I tried this (below)... (0 Replies)
Discussion started by: lectersmeal
0 Replies

5. Shell Programming and Scripting

Carbon copy using mailx command in HP-UX

Can anyone give me the code to carbon copy a mail using mailx command in HP-UX. I want to put the code in shell script. (3 Replies)
Discussion started by: makauser
3 Replies
gvfs-cat(1)							   User Commands						       gvfs-cat(1)

NAME
gvfs-cat - print a file to standard output using the VFS system SYNOPSIS
gvfs-cat URI DESCRIPTION
gvfs-cat prints a file to standard output using the virtual file system to access the file via a URI. OPERANDS
The following operands are supported: URI Specifies the file location in standard URI format. EXAMPLES
Example 1: Cat a File From a Web Server example% gvfs-cat http://www.sun.com Example 2: Cat a Local File example% gvfs-cat file:///home/user/README.txt ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables: NLSPATH. EXIT STATUS
The exit value 0 is returned regardless of success or failure. FILES
The following files are used by this application: /usr/bin/gvfs-cat Executable to print a file to standard output using the VFS system ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-gvfs | +-----------------------------+-----------------------------+ |Interface stability |Volatile | +-----------------------------+-----------------------------+ SEE ALSO
gvfs-copy(1), gvfs-info(1), gvfs-less(1), gvfs-ls(1), gvfs-mkdir(1) gvfs-monitor-dir(1), gvfs-monitor-file(1), gvfs-mount(1), gvfs-move(1), gvfs-rename(1), gvfs-open(1), gvfs-rm(1), gvfs-save(1), gvfs-trash(1), gvfs-tree(1), attributes(5), environ(5) NOTES
Written by Alvaro Lopez Ortega, Sun Microsystems Inc., 2008. SunOS 5.11 25 Mar 2008 gvfs-cat(1)
All times are GMT -4. The time now is 01:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy