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

  • Home
  • SEARCH
  • 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 8138749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:35:48+00:00 2026-06-06T11:35:48+00:00

I am using following options set -o pipefail set -e In bash script to

  • 0

I am using following options

set -o pipefail
set -e

In bash script to stop execution on error. I have ~100 lines of script executing and I don’t want to check return code of every line in the script.

But for one particular command, I want to ignore the error. How can I do that?

  • 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-06-06T11:35:50+00:00Added an answer on June 6, 2026 at 11:35 am

    The solution:

    particular_script || true
    

    Example:

    $ cat /tmp/1.sh
    particular_script()
    {
        false
    }
    
    set -e
    
    echo one
    particular_script || true
    echo two
    particular_script
    echo three
    
    $ bash /tmp/1.sh
    one
    two
    

    three will be never printed.

    Also, I want to add that when pipefail is on,
    it is enough for shell to think that the entire pipe has non-zero exit code
    when one of commands in the pipe has non-zero exit code (with pipefail off it must the last one).

    $ set -o pipefail
    $ false | true ; echo $?
    1
    $ set +o pipefail
    $ false | true ; echo $?
    0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came up with the following options: Using the goto statement: Start: goto Data
I am currently using PHP_Beautifier for formatting code with the following command like options
I'm using the following jQuery plugin: http://slidesjs.com/ I've set the play attribute to 30000
I am trying to set default value in DateField using the following statement DateField
Assume your .NET-based development team is already using the following set of tools in
I have the following regex in a PHP script $total_matches = preg_match_all('{ <a\shref= (?<link>[^]+)
Why do I have to SET ARITHABORT ON when using xml in sql server
I'm using Jquery Ui to make a dialog using the following options: $(#locations-dialog).dialog({ autoOpen:
I am using following selector to remove single item in select. jQuery(#stateCity option[value='Adak, AK,
Using the following JQuery/AJAX function I'm calling a partial view when an option is

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.