Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 881887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:20:13+00:00 2026-05-15T12:20:13+00:00

My build and deploy step creates some logs. I would like to search the

  • 0

My build and deploy step creates some logs. I would like to search the logs for and fail the build if I see certain strings.

A good log looks like

log stuff
step 1: SUCCESS
step 2: SUCCESS

A log with failures would look like

log stuff
step 1: SUCCESS
step 2: FAIL

My check is

grep FAIL /path/to/build.log
if [ $? -eq 0 ]; then
  exit 1
fi

I’ve also tried

RESULT=`grep FAIL /path/to/build.log`
if [ -n "$RESULT" ]; then
  exit 1
fi

and various ways of piping in the file.

Hudson is failing the build on grep not returning anything. So is there a better way to search for the string? Is there a way to have grep not returning anything not exit the script right there?

Version Stuff:
* Hudson 1.355

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T12:20:13+00:00Added an answer on May 15, 2026 at 12:20 pm

    From the hudson documentation for a shell command:

    By default, the shell will be invoked with the “-ex” option. So all of the commands are printed before being executed, and the build is considered a failure if any of the commands exits with a non-zero exit code. Again, add the #!/bin/… line to change this behavior.

    So, try adding a #!/bin/sh line and see what it does?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built an MSI that I would like to deploy, and update frequently.
I've been following this tutorial (lesson 6) in order to build and deploy a
We have inherited an ant build file but now need to deploy to both
I build up an array of strings with string[] parts = string.spilt( ); And
I am using ANT to deploy build in to Tomcat Server. I Want to
I have a project which I can build and deploy correctly using Ant I
I've got a simple Struts 2 application that I build and deploy to glassfish
My VS2010 database deploy is failing on my build server, which has SQL Server
I would like to use JPA2 Criteria API with metamodel objects, which seems to
I'm trying to use SPVisualDev to build and deploy my SharePoint feature. It builds

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.