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 8345173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:35:53+00:00 2026-06-09T06:35:53+00:00

I know that the @ prefix suppresses output from a shell command in Makefiles,

  • 0

I know that the @ prefix suppresses output from a shell command in Makefiles, and also that the - prefix will ignore errors from a shell command. Is there a way to combine the two, i.e. a prefix that suppresses output and ignores errors? I don’t think @- or -@ works.

  • 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-09T06:35:54+00:00Added an answer on June 9, 2026 at 6:35 am

    Actually, @- and -@ both do work, but will print a make: [target] Error 1 (ignored) warning.

    Instead, you can use

    @command || true
    

    or, since : is shorthand for true in shell,

    @command ||:
    

    This often a better thing to do, because it avoid Make’s confusing warning that an error was ignored in an invisible command.

    Consider the two most common cases where you might want to ignore the return value of a command:

    1. Part of the build is broken and you want to continue anyway, in which case you’ve got some learning to do. The build is broken and needs to be fixed, not bandaided in an unmaintainable way.
    2. A command returns a non-zero exit code even though it did exactly what you wanted, in which case you don’t really want Make to issue a warning.

    For the second case, consider the example of grepping for warnings in the log file produced by a command. grep will return an error if it does not find a match, which is not what you want:

    .PHONY: all one two three
    
    all: at-warning at-success or-success or-warning
    
    at-%: %.log
        @echo Making $@
        @-grep ^Warning $<
    
    or-%: %.log
        @echo Making $@
        @grep ^Warning $< ||:
    
    success.log:
        echo 'Success!' > $@
    
    warning.log:
        echo 'Warning: foo' > $@
    
    clean::
        rm -f {success,warning.log}
    

    produces:

    echo 'Warning: foo' > warning.log
    Making at-warning
    Warning: foo
    Making at-success
    make: [at-success] Error 1 (ignored)
    Making or-success
    Making or-warning
    Warning: foo
    

    Using @- produces a nonsensical ignored error warning when there is success, while || true handles both warnings and the absence of warnings without complaint.

    Theoretically using || true is slower than using @-, but this overhead is unlikely to be a bottleneck in well-designed and -maintained build systems. The vast majority of the time should be spent building, or checking timestamps when there is nothing to build, not in running the thousands of quick commands whose return values all get ignored that would be necessary for this to have a measurable performance impact.

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

Sidebar

Related Questions

I know that this line of code will make the cell text-wrap: $objPHPExcel->getActiveSheet()->getStyle('D1')->getAlignment()->setWrapText(true); 'D1'
I know that 0x is a prefix for hexadecimal numbers in Javascript. For example,
We all know that CSS prefix for Mozilla (Gecko), when we refer that property
I read from the official tutorial of Java that prefix and postfix ++ --
I know that on the iPhone you can register a URL prefix such as
I would like to know if there is, in Java, a function that can
I want the Name of the Contact which includes (FAMILY_NAME, GIVEN_NAME,MIDDLE_NAME,PHONETIC_FAMILY_NAME,PHONETIC_GIVEN_NAME,PHONETIC_MIDDLE_NAME,PREFIX,SUFFIX). I know that
I know that constants start with the k prefix, but does anyone have their
I know that Phonegap has an event for back button, but it's only available
I know that this sort of question has been asked here before, but still

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.