Code Fragment Collection
Web
asperix.org
Home
Contact
Categories
BASH
Shell
PHP
APL
SQL
C++
All
Documentation
License
Related
C++ Articles
APL Library
Math Library
Geo Library
mirzoyan.com
C++ Articles
Humor
Typical die function
This function just prints the message and exists. The general usage can be something like that:
do_some_thing || die "could not do it"
function die() { echo "$@" 1>&2 exit 1 }
<
1
2
Copyright (C) 2006 Andrey Mirzoyan