The "function" keyword is defined in ksh88, but not in the POSIX shell definition for 1992 (there were a few reasons that much ksh functionality was removed). People call this a "bashism" because they do not realize that the syntax originated in Korn. Debian/Ubuntu use a POSIX system shell (dash) that does not recognize (almost) any korn/bash extended syntax.<p>Here is my shell function to search for processes using shell patterns (these are <i>not</i> regular expressions):<p><pre><code> pps () { local a= b= c= IFS=$'\0'; ps ax | while read -r a
do [ "$b" ] || c=1; for b; do case "$a" in *"$b"*) c=1;;
esac; done; [ "$c" ] && printf '%s\n' "$a" && c=; done; }
</code></pre>
I have a fancy wrapper for .netrc password storage with SFTP, which is a little more extreme, if there is any interest.