Shell: Difference between revisions

No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:


* stderr to pipe, without stdout: <tt>2>&1 >/dev/null |</tt>
* stderr to pipe, without stdout: <tt>2>&1 >/dev/null |</tt>
==Useful functions==
<syntaxhighlight lang="sh">
isnumber() {
  case "$1" in
    ''|*[!0-9]*) echo "not a number: $1" >&2 ; return 1 ; ;;
    *) return 0
  esac
}
</syntaxhighlight>