Q: Relying on exit code of journalctl -g ....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

It's not documented, but "journalctl -g ..." seems to exit with success when the pattern was found, and with 1 when it was not.
Can I rely on that?

The other thing is when grepping across reboots, the "-- Reboot --" is always output, even if it does not match the pattern. Is that a bug or a feature?

(systemd-246.16 of SLES15 SP3)

Actually I had some "quiet grep" in mind that only sets the exit code depending whether some message was found or not.

Regards,
Ulrich







[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux