Sponsored Content
Top Forums Shell Programming and Scripting E-mail Output Merge Lines for Some Text.. Post 302906333 by aimy on Thursday 19th of June 2014 12:48:47 PM
Old 06-19-2014
E-mail Output Merge Lines for Some Text..

Hi all.

This is the content of the text file used for the e-mail:
Code:
TM ICP-EDW BILLING REGISTER USAGE BREAKDOWN_01062014.csv
TM_ICP_EDWH_FICL_13062014.TXT
TM_ICP_EDWH_FICL_16062014.TXT
TM_ICP_EDW_Detailed Payment Journal Report_13062014.txt
TM_ICP_EDW_Detailed Payment Journal Report_14062014.txt
TM_ICP_EDW_Detailed Payment Journal Report_15062014.txt
TM_ICP_EDW_Detailed Payment Journal Report_16062014.txt
TM_ICP_EDW_Detailed Payment Journal Report_17062014.txt
TM_ICP_EDW_Detailed Payment Journal Report_18062014.txt
TM_ICP_EDW_Detailed Payment Journal Report_19062014.txt
TM_ICP_EDW_FA_REFUND_CONSUMER_01062014.csv
TM_ICP_EDW_FA_REFUND_SME_01062014.csv
TM_ICP_EDW_FIN04-ACCOUNT_CONSOL_20140613.csv
TM_ICP_EDW_FIN04-ACCOUNT_CONSOL_20140614.csv
TM_ICP_EDW_FIN04-ACCOUNT_CONSOL_20140615.csv
TM_ICP_EDW_FIN04-ACCOUNT_CONSOL_20140616.csv
TM_ICP_EDW_FIN04-ACCOUNT_CONSOL_20140618.csv
TM_ICP_EDW_FIN04-ACCOUNT_CONSOL_20140619.csv
TM_ICP_EDW_FM-235A_LAPORAN_RINGKASAN_TRANSAKSI_BAYARAN_FAMIS_12062014.txt
TM_ICP_EDW_FM-235A_LAPORAN_RINGKASAN_TRANSAKSI_BAYARAN_FAMIS_14062014.txt
TM_ICP_EDW_FM-235A_LAPORAN_RINGKASAN_TRANSAKSI_BAYARAN_FAMIS_16062014.txt
TM_ICP_EDW_FM-235A_LAPORAN_RINGKASAN_TRANSAKSI_BAYARAN_FAMIS_17062014.txt
TM_ICP_EDW_LIST_OF_ACCOUNT_WITH_STREAM_CODE_2_3_SERIES_01062014.csv
TM_ICP_EDW_PELANGGAN_ATD_DAN_ANTARABANGSA(OPR)_N_01062014.csv

This is the command that is used:
Code:
{ echo "FIRST" ; cat ftp_list.txt ; echo "LAST" ; } | /usr/bin/mailx -s "CAMELOT-MS Portal Missing Reports" my_email@company.com

But when the e-mail is received, this is what I actually get:
Code:
FIRST
TM ICP-EDW BILLING REGISTER USAGE BREAKDOWN_01062014.csv TM_ICP_EDWH_FICL_13062014.TXT TM_ICP_EDWH_FICL_16062014.TXT TM_ICP_EDW_Detailed Payment Journal Report_13062014.txt TM_ICP_EDW_Detailed Payment Journal Report_14062014.txt TM_ICP_EDW_Detailed Payment Journal Report_15062014.txt TM_ICP_EDW_Detailed Payment Journal Report_16062014.txt TM_ICP_EDW_Detailed Payment Journal Report_17062014.txt TM_ICP_EDW_Detailed Payment Journal Report_18062014.txt TM_ICP_EDW_Detailed Payment Journal Report_19062014.txt TM_ICP_EDW_FA_REFUND_CONSUMER_01062014.csv
TM_ICP_EDW_FA_REFUND_SME_01062014.csv
TM_ICP_EDW_FIN04-ACCOUNT_CONSOL_20140613.csv
TM_ICP_EDW_FIN04-ACCOUNT_CONSOL_20140614.csv
TM_ICP_EDW_FIN04-ACCOUNT_CONSOL_20140615.csv
TM_ICP_EDW_FIN04-ACCOUNT_CONSOL_20140616.csv
TM_ICP_EDW_FIN04-ACCOUNT_CONSOL_20140618.csv
TM_ICP_EDW_FIN04-ACCOUNT_CONSOL_20140619.csv
TM_ICP_EDW_FM-235A_LAPORAN_RINGKASAN_TRANSAKSI_BAYARAN_FAMIS_12062014.txt
TM_ICP_EDW_FM-235A_LAPORAN_RINGKASAN_TRANSAKSI_BAYARAN_FAMIS_14062014.txt
TM_ICP_EDW_FM-235A_LAPORAN_RINGKASAN_TRANSAKSI_BAYARAN_FAMIS_16062014.txt
TM_ICP_EDW_FM-235A_LAPORAN_RINGKASAN_TRANSAKSI_BAYARAN_FAMIS_17062014.txt
TM_ICP_EDW_LIST_OF_ACCOUNT_WITH_STREAM_CODE_2_3_SERIES_01062014.csv
TM_ICP_EDW_PELANGGAN_ATD_DAN_ANTARABANGSA(OPR)_N_01062014.csv
LAST

It sort of it has something to do with those filenames with spaces in it.

Could this be fixed?

Thanks a lot.

---------- Post updated 06-20-14 at 12:48 AM ---------- Previous update was 06-19-14 at 01:59 PM ----------

The problem is weird right? Anyone?

TQ.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

mail merge

dear friends plese give me full shell script for mail merge facilityu. i.e. to create a letter file i.e to create data file and report maile merge using shell scripitng. when run the programme ask for fields and store in a file and from another program when run that mail merge file... (3 Replies)
Discussion started by: cvvsnm
3 Replies

2. Shell Programming and Scripting

Cronjob - Redirect mail output to file, LINES & COLUMNS

I currently have an expect script that issues the 'mail' command and sends an 'x' when it receives the & prompt from mail to quit. The expect script is able to do stty rows 100 columns 200 < $spawn_out(slave,name) to set up the number of columns and rows. I would like to get rid of the expect... (0 Replies)
Discussion started by: jharvey
0 Replies

3. Shell Programming and Scripting

need to search text and output previous lines

I have a file (OMlog0) that is quite large, I need to find the line "Automatic Recharge Audit Process Finished" and output that line and the time stamp that occurs two lines previous. The line that I was using is "sed -n '/Automatic Recharge Audit Process Finished/,/No errors/p' /sn/log/OM* >... (8 Replies)
Discussion started by: grinds
8 Replies

4. Shell Programming and Scripting

Add text before lines in command output

Hi2all, I have following command in IBM HMC console: lssyscfg -r prof -m Server-9117-MMA-SN655D350 -F lpar_name,min_mem,desired_mem --header which gives me the following output: lpar_name,min_mem,desired_mem lpar1,1024,2048 lpar2,1024,2048 lpar3,2048,4096 What I want is to add in... (3 Replies)
Discussion started by: UsRb
3 Replies

5. Shell Programming and Scripting

Merge lines in a file with Awk - incorrect output

Hi, I would like: FastEthernet0/0 is up, line protocol is up 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 output errors, 0 collisions, 0 interface resets Serial1/0:0 is up, line protocol is up 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 0... (14 Replies)
Discussion started by: mv652
14 Replies

6. Shell Programming and Scripting

Merge lines in text file based on pattern

Hello, I have searched forum trying to find a solution to my problem, but could not find anything or I did not understand the examples.... I should say, I am very inexperienced with text processing. I have a text file with approx 60k lines in it. I need to merge lines based on the number... (8 Replies)
Discussion started by: Bertik
8 Replies

7. Shell Programming and Scripting

remove blank lines and merge lines in shell

Hi, I'm not a expert in shell programming, so i've come here to take help from u gurus. I'm trying to tailor a csv file that i got to make it work for the LOAD FROM command. I've a datatable csv of the below format - --in file format xx,xx,xx ,xx , , , , ,,xx, xxxx,, ,, xxx,... (11 Replies)
Discussion started by: dvah
11 Replies

8. Shell Programming and Scripting

How to merge lines based off of text?

Hello Everyone, I have two files, similar to the following: File 1: 8010 ITEM01 CODE1 FLAG1 filler filler 7020 OBJECT CODE2 FLAG2 filler 6010 THING1 CODE4 FLAG4 6011 ITEM20 CODE7 FLAG7 File 2 contains: 6020 ITEM01 CODEA FLAGA filler filler filler 7000 OBJECT CODEB... (2 Replies)
Discussion started by: jl487
2 Replies

9. UNIX for Dummies Questions & Answers

Merge two text files by two fields and mixed output

Hello, I'm back again looking for your precious help- This time I need to merge two text files with matching two fields, output only common records with mixed output. Let's look at the example: FILE1 56153;AAA0708;3;TEST1TEST1; 89014;BBB0708;3;TEST2TEST2; 89014;BBB0708;4;TEST3TEST3; ... (7 Replies)
Discussion started by: emare
7 Replies

10. UNIX for Beginners Questions & Answers

Manipulate condition to send mail based on output text in file

Hi All, I have a working script as below. echo "Files loaded with $(cat /var/tmp/script.X1.out)" | mail -s "Files loaded with return code" mailid This script takes the output from script.X1.out file and appends the text "Files loaded with return code" and sends the email. Now what I want... (5 Replies)
Discussion started by: midhun3108
5 Replies
All times are GMT -4. The time now is 07:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy