Quantcast
Channel: User Zoredache - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 41

Negate exit code without using shell features

$
0
0

Is there any standard command that will negate the the exit code of another command provided as an argument without using shell features, or starting a shell?

I have a program that does something based on exit code of an system() call. I have another program that returns its status via the exit code. But the program I am calling returns the results opposite from what I want. I can simply specify something like bash -c '....', but is there an easier way?

P.S. Yes, I know I am probably trying to optimize something that probably doesn't really matter all that much. But mostly I am curious, since unix seems to have a command for almost everything, why I can't find a simple negate-the-exit-code command.


Viewing all articles
Browse latest Browse all 41

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>