4

global bash shell functions

view full story
linux-howto

http://www.linuxquestions.org – Hi, I wonder if there is anyway to make a user-defined bash shell function global, meaning the function can be use in any bash shell scripts, interactively or not. This is what I attempted: Code: $ tail -n 3 /etc/bashrc echotm () {   echo "[`date`] $@" } $ echotm hello world [Mon Sep 13 17:15:28 HKT 2010] hello world $ cat a.sh #!/bin/sh echotm hello world $ sh a.sh a.sh: line 2: echotm: command not found Any idea? (HowTos)