Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Mail - stops listing after 34 lines with a "?" Post 303005396 by abruck on Tuesday 17th of October 2017 04:49:22 PM
Old 10-17-2017
Mail - stops listing after 34 lines with a "?"

Hope all is well with you and yours.

I have a quick unix/Linux mail question.

I need to get some data from all received mail and load it into the PostgreSQL DB. I use fetchmail to get them from a remote server and they go to /var/mail/abruck

There are 2 lines that I need from each email: Date and Subject.

When I just type "mail" to get the mail content, I get exactly what I want:

Code:
U 1 Dispatch Team Tue Oct 17 11:55 192/11778 (FOLLOW-UP) 1 - Emergency Work Order# WO-0003342 at (Ranch) | ETA NEEDED - CRM:01136317
U 2 Dispatch Team Tue Oct 17 11:55 289/18637 4 - Normal Work Order# WO-0003304 SCHEDULED for 8/8/2017 4:30 PM (Wents) - CRM:01136334
U 3 Dispatch Team Tue Oct 17 11:55 289/18637 4 - Normal Work Order# WO-0003304 SCHEDULED for 8/9/2017 4:00 PM (Wents) - CRM:01136338
......
U 33 Dispatch Team Tue Oct 17 11:55 187/11550 (FOLLOW-UP) 2 - Critical Work Order# WO-0002897 at (Calas) | ETA NEEDED - CRM:01136469
U 34 Dispatch Team Tue Oct 17 11:55 190/11725 (FOLLOW-UP) 1 - Emergency Work Order# WO-0003342 at (Ranch) | ETA NEEDED - CRM:01136473

?


except that it stops after 34 lines with a "?"

How can I get ALL the emails without stopping every 34 lines with a "?". I want go > it all into one file.

Greatly appreciate your time and efforts ...

All the Best!

Last edited by Scott; 10-17-2017 at 05:56 PM.. Reason: Please use code tags, and don't paste rich-text, it's a pain to tidy up. Thanks.
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

3. AIX

echo $varibla | mail -s "subject" "xxx@xxx.com" not ruuning as expected

Hi Folks, As per the subject, the following command is not working as expected. echo $variable | mail -s "subject" "xxx@xxx.com" Could anyone figure it out whats wrong with this. I am using AIX box. Regards, (2 Replies)
Discussion started by: gjarms
2 Replies

4. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

5. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

6. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
MAIL(1) 						      General Commands Manual							   MAIL(1)

NAME
mail - send and receive electronic mail SYNOPSIS
mail [-dpqrv] [-f file] [user] OPTIONS
-d Force use of the shell variable MAILER -f Use file instead of /usr/spool/mail/user as mailbox -p Print all mail and then exit -q Quit program if SIGINT received -r Reverse print order, i.e., print oldest first -v Verbose mode EXAMPLES
mail ast # Send a message to ast mail # Read your mail DESCRIPTION
Mail is an extremely simple electronic mail program. It can be used to send or receive email on a single MINIX system, in which case it functions as user agent and local delivery agent. If the flag MAILER is defined in mail.c, it can also call a transport agent to handle remote mail as well. No such agent is supplied with MINIX. When called by user with no arguments, it examines the mailbox /usr/spool/mail/user, prints one message (depending on the -r flag), and waits for one of the following commands: <newline> Go to the next message - Print the previous message !command Fork off a shell and execute command CTRL-D Update the mailbox and quit (same as q) d Delete the current message and go to the next one q Update the mailbox and quit (same as CTRL-D) p Print the current message again s [file] Save message in the named file x Exit without updating the mailbox To send mail, the program is called with the name of the recipient as an argument. The mail is sent, along with a postmark line containing the date. For local delivery, a file named after the recipient in the directory /usr/spool/mail must be writable. If the directory /usr/spool/mail does not exist then the mail is dumped on the console, so that system programs have a way to notify a user on a system that does not have a mail spool. MAIL(1)
All times are GMT -4. The time now is 02:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy