LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-20-2023, 04:18 AM   #1
lakshana
LQ Newbie
 
Registered: Nov 2022
Posts: 28

Rep: Reputation: 0
text file attached


Currently, i am not getting the text file attachment.
Quote:
echo -e "complete" | mailx -s "process complete" -a ${OUTFILE} ${email}
 
Old 06-20-2023, 04:21 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,964

Rep: Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332Reputation: 7332
and did you get any error message?
did you check your script with shellcheck?
 
Old 06-20-2023, 04:36 AM   #3
lakshana
LQ Newbie
 
Registered: Nov 2022
Posts: 28

Original Poster
Rep: Reputation: 0
File is getting attached. Manually need to open. Instead need the text file attaced.
 
Old 06-20-2023, 05:13 AM   #4
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,808

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
You want to join it to the body text?
Code:
( echo -e "complete"; cat ${OUTFIE} ) | mailx -s "process complete" ${email}
Note that both sides of the pipe run in a sub shell.
Even a { command group } is forced into a sub shell
Code:
{ cat ${OUTFIE}; echo "complete"; } | mailx -s "process complete" ${email}

Last edited by MadeInGermany; 06-20-2023 at 05:15 AM.
 
1 members found this post helpful.
Old 06-20-2023, 05:42 AM   #5
lakshana
LQ Newbie
 
Registered: Nov 2022
Posts: 28

Original Poster
Rep: Reputation: 0
it works.

Last edited by lakshana; 06-20-2023 at 06:24 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can vim have tabs attached to viewports instead of viewports attached to tabs? frznchckn Linux - Software 0 11-17-2010 08:15 PM
How to parse text file to a set text column width and output to new text file? jsstevenson Programming 12 04-23-2008 02:36 PM
pl2303 attached to ttyUSB0 but driver attached to device is "serial" sheeluh Linux - Software 4 03-12-2007 04:27 AM
How can I say mouse is attached or not attached at the serial port ? lovelylinux Linux - Hardware 1 02-07-2007 09:44 AM
Serial Mouse is attached or not attached at seiral port lovelylinux Linux - Hardware 1 01-28-2007 07:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration