mainThe GNU Bourne-Again SHell - Support: sr #108738, Add built-in err and warn commands

 
 

sr #108738: Add built-in err and warn commands

Submitter:  None
Submitted:  Sat 31 Jan 2015 03:17:17 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  1 - Wish Status:  Wont Do
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 13 Nov 2015 10:23:13 PM UTC, comment #1: 

I don't think there is enough reason to make these part of the shell itself, considering how trivial they are to implement as shell functions.

They are a good argument for shell function libraries.

Chet Ramey <chet>
Group administrator
Sat 31 Jan 2015 03:17:17 PM UTC, original submission:  

For a lifetime now, I have had to duplicate functions like those mentioned, whenever I am forced to create a stand-alone script.  It would be ultra handy to have them incorporated into bash to save the effort in pasting in the same patterns each time I write a stand alone script.  For other scripts, I import them from a standard library of functions, but I probably have a few hundred system scripts with the same 8 lines in them:


function warn() {
    echo >&2 "${0##*/}: $*"
}

function err() {
    warn "$@"
    exit 1
}


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-11-13 chet StatusNone Wont Do

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code