Sponsored Content
Top Forums Shell Programming and Scripting Ksh: Send a mail in case grep finds something Post 302918614 by Makarand Dodmis on Wednesday 24th of September 2014 12:10:09 PM
Old 09-24-2014
your problem solved...
try
Code:
var=$(grep somestring somefile) && [[ ! -z "${var}" ]] &&  echo "${var}"|mailx -s "Found something" email@mycomp.com

Courtesy : Pilnet
This User Gave Thanks to Makarand Dodmis For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Appending to filename a string of text grep finds

I am wanting to automate a process that includes the step of appending to a filename a string of text that's contained inside the file. I.e. if filename A.fileA contains a string of text that reads 1234 after the phrase ABC, I want the shell script file to rename the file 1234_FileChecked_A.fileA.... (3 Replies)
Discussion started by: HLee1981
3 Replies

2. Shell Programming and Scripting

Send an e-mail using ksh

Hi, I have a small script that outputs to a text file. I need to e-mail the contents of the text file to a mail alias. However, I cannot seem to get the script to print the 'subject', my script just leaves it blank. Has anybody any ideas what is wrong? if then (echo "\nHere is the report... (3 Replies)
Discussion started by: asulli01
3 Replies

3. UNIX for Dummies Questions & Answers

How to send html file in a mail not as an attachment but it should display in the mail in table for

Hi The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment . cat Employee.sql SET VERIFY OFF SET PAGESIZE 200 SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON - HEAD... (0 Replies)
Discussion started by: mani_isha
0 Replies

4. Shell Programming and Scripting

Calling SQL script from ksh job and send mail on some error.

Hi, I am trying to call sql script from ksh job with parameters.The parameters passed from ksh job will be used in SELECT query in sql file to SPOOL the data in extract file.My questions are: 1) How to call a sql script from ksh job with parameters? 2) How to use the parameter in sql file to... (1 Reply)
Discussion started by: anil029
1 Replies

5. UNIX for Advanced & Expert Users

need to configure mail setting to send mail to outlook mail server

i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail. actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies

6. Shell Programming and Scripting

ksh program that finds the lowest number in a .txt file

i am having a problem finding the lowest number after punching in a bunch of numbers in the .txt file but its probably the way i have the code set up. help please! (4 Replies)
Discussion started by: tinsteer
4 Replies

7. Shell Programming and Scripting

I want my script to NOT to send an e-mail if it finds the same keyword more than twice.

My script triggers and e-mail if keywords supplied to it were found. Problem is if it find the same keyword continously (due to continous server errors), it triggers mails and fillup my mail box with same message (which is not required) I want my script to NOT to send an e-mail if it finds the... (13 Replies)
Discussion started by: Rajeshneemkar
13 Replies

8. UNIX for Beginners Questions & Answers

Grep the 'not running' jobs and will send the update in mail with its name(job)

my request is: i have to create a script , which will grep the 'not running' jobs and will send the update in mail with its name(job) Scenario: logged in to machine abc went to particular path: cd /a/b/c then ./script1.sh status (script.sh is a script,whose status gives info about 10 jobs... (1 Reply)
Discussion started by: learner987
1 Replies

9. UNIX for Beginners Questions & Answers

Read a file and send mail based on grep

Hi All, I am having a job and I need to send email when the job is running. On any other case (success,fail) I don't needed to send email. I check with BMC they told they dont have that in the version I am using. So I created a dependent job and grepped for the status and sent email. My... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

10. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies
JAVAHELPER(1)							   User Commands						     JAVAHELPER(1)

NAME
Javahelper - Part of the Java Helper packaging tools Refer to the tutorials in /usr/share/doc/javahelper for more detail SYNOPSIS
jh_makepkg [options] OPTIONS
-h --help: show this text -V --version: show the version -p<name> --package=<name>: Set the name of the package (defaults to directory name without version) -m<name> --maintainer=<name>: Set the maintainer name (defaults to DEBFULLNAME, NAME, or the user's full name) -e<email> --email=<email>: Set the maintainer email (defaults to DEBEMAIL EMAIL or user@host) -v<version> --upstream=<version>: Set the upstream version (defaults to the directory name after a -) -c --clean: Tidy up common problems with Java source packages. Removes .class, .jar files and pre-built javadoc trees before creating the orig.tar.gz Pick One: -l --library: This is a library package -a --app: This is an application package Pick One: -t --ant: Build with ant -k --makefiles: Build with make -n --none: Create own buildsystem Pick One: -g --gcj: Build with gcj -d --default: Build with default free compiler -o --openjdk: Build with OpenJDK 6 -o7 --openjdk7: Build with OpenJDK 7 Environment Variables: DEBEMAIL: Default maintainer email address EMAIL: Default maintainer email address DEBFULLNAME: Default maintainer name NAME: Default maintainer name Javahelper Version 0.5 January 2008 JAVAHELPER(1)
All times are GMT -4. The time now is 11:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy