Bug 182938 - feature request - new command for nash: on_success
Summary: feature request - new command for nash: on_success
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: mkinitrd
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Peter Jones
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks: 197695
TreeView+ depends on / blocked
 
Reported: 2006-02-24 16:53 UTC by Don Zickus
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 5.0.47-1
Clone Of:
Environment:
Last Closed: 2006-07-13 17:13:03 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
tiny fix for condCommand (438 bytes, patch)
2006-05-17 22:28 UTC, Don Zickus
no flags Details | Diff

Description Don Zickus 2006-02-24 16:53:59 UTC
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:

Comment 1 Peter Jones 2006-03-30 23:19:21 UTC
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.

Comment 2 Don Zickus 2006-05-17 22:28:59 UTC
Created attachment 129371 [details]
tiny fix for condCommand


simple little fix... not so simple to find

Comment 3 Don Zickus 2006-05-17 22:30:18 UTC
another nitpick is the -eq is coded as -et but whatever..

Comment 5 Peter Jones 2006-07-11 14:09:35 UTC
Fixed in CVS, will be in the next build.  Also added "-eq" (but left "-et" in
for compatibility).


Note You need to log in before you can comment on or make changes to this bug.