This may be a silly question, as I'm not super experienced with writing bash scripts (and Rust), but I'm trying to use nixos-needsreboot to set up a simple email notification. But I don't know how I'm supposed to catch the exit code. I get:
❯ nix run github:thefossguy/nixos-needsreboot -- --dry-run
Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
~
❯ echo $?
1
Is this the supposed behavior? I expected echo $? to print 2 since the output says code: 2 but I'm also a bit unsure whether there is a problem since it complains about "No such file or directory".
Thanks in advance and best regards,
BerriJ
This may be a silly question, as I'm not super experienced with writing bash scripts (and Rust), but I'm trying to use nixos-needsreboot to set up a simple email notification. But I don't know how I'm supposed to catch the exit code. I get:
❯ nix run github:thefossguy/nixos-needsreboot -- --dry-run Error: Os { code: 2, kind: NotFound, message: "No such file or directory" } ~ ❯ echo $? 1Is this the supposed behavior? I expected
echo $?to print2since the output sayscode: 2but I'm also a bit unsure whether there is a problem since it complains about"No such file or directory".Thanks in advance and best regards,
BerriJ