Description of problem: We talked about adding this command previously. Just to refresh, I wanted to add the command "on_success" that would only continue upon success (return code 0) of the previous command. This will be used with the kdump/kexec project. Version-Release number of selected component (if applicable): How reproducible: easily Steps to Reproduce: 1. find a project that needs to use nash 2. convince yourself that you need conditionals 3. viola!! feature request. Actual results: Expected results: Additional info:
This is implemented in 5.033-1 as the "cond" command. example usage: #!/bin/nash foo # run "foo" cond bar # if foo returned 0, run "bar" foo # run "foo" cond -ne 0 bar # if foo returned anything but 0, run "bar" In addition to "-ne", "-eq", "-lt", "-le", "-ge", and "-gt" are provided. Their meaning is left to the reader.
Created attachment 129371 [details] tiny fix for condCommand simple little fix... not so simple to find
another nitpick is the -eq is coded as -et but whatever..
Fixed in CVS, will be in the next build. Also added "-eq" (but left "-et" in for compatibility).