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
to set up the number of columns and rows.
I would like to get rid of the expect script and replace it with a simple shell script to do something like:
Where x.txt simply has an x in it that will end mail when it looks for input.
However, the list of mail messages is truncated because of the number of rows and columns or LINES and COLUMNS.
I've tried doing
before issuing the mail command in the console but it appeared to have no effect. I also tried in the bash script but that printed an error as expected since stty can't be issued in scripts from a cronjob (no term). I've also tried exporting LINES and COLUMNS environment variables but it did not help.
I'm sure there is an easy work around but I can't figure this out.
I have a shell script that runs on our webserver logs, and grabs various useful data and then outputs this data to a .csv file.
What I want to do now is schedule a cronjob to run this script for me each week at a designated time, AND email the .csv file that is created as an attachment to... (1 Reply)
ENVIROMENT
Linux: RHEL 6.4
Log Path: /usr/iplanet/servers/https-company/logs
Log Format: user.log.03-15-2015
I have log4j log rotation enabled rotating files on a daily basis.
The rotated logs are NOT compressed & are taking up too much space.
I need a script that will run daily that... (1 Reply)
Hi all.
This is the content of the text file used for the e-mail:
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... (9 Replies)
Hi All,
I would like to send below output in a tabular column ( xml or excel ) and send a mail.
vinay unix
anil sql
vamsee java
request to suggest a solution. (1 Reply)
Hi Guys,
I want to redirect the output of 3 scripts to a file and then mail the output of those three scripts.
I used below but it is not working:
OFILE=/home/home1/report1
echo "report1 details" > $OFILE
=/home/home1/1.sh > $OFILE
echo... (7 Replies)
Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions.
... (4 Replies)
Hi All,
I need read the file and out put format as below using ksh, I wrote below script its keep on repeating first line in the file.
may i know the best way to get the below out put while incrementing line in the file.
cat b.txt |awk '{print $0}' |while read line
do
aa=`cat $line |head -1... (7 Replies)
Dear unix gurus,
I have a data file with header information about a subject and also 3 columns of n rows of data on various items he owns. The data file looks something like this:
adam peter
blah blah blah
blah blah blah
car
01 30 200
02 31 400
03 57 121
.. .. ..
.. .. ..
n y... (8 Replies)
I'm writing a script using file descriptor 2 (std error) to send an email only if the command fails or errors out but the script always emails me irrepective of whether it fails or not. It will not email the /tmp/check.error file output if doesn't error out just the mail with the subject "Cannot... (3 Replies)