Advertisement

07.12.2008 at 10:41AM PDT, ID: 23559820
[x]
Attachment Details

Beginners question about an enhancement to a shell script

Asked by holmesrk in Bourne Shell (sh), Shell Scripting

Tags: shell script

I'm new to scripting and have a question about enhancing a simple shell script.

I'm simply running a java program and then piping the output to mailx. What do I need to add to this script to include logic which won't send the email if there isn't any output from the java program?Start Free Trial
1:
2:
3:
4:
#!/bin/sh
# Automated resubmission script v.1
cd /page/sys1/cr/bin
java ManualResubmit|mailx -s "Output from Automated Resubmit" user@domain.com
[+][-]07.12.2008 at 11:36AM PDT, ID: 21989994

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2008 at 11:59AM PDT, ID: 21990054

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.12.2008 at 01:59PM PDT, ID: 21990361

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Bourne Shell (sh), Shell Scripting
Tags: shell script
Sign Up Now!
Solution Provided By: Tintin
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.14.2008 at 07:34AM PDT, ID: 21998424

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628