Put the following content into /etc/profile.d/PHE_function.sh.
cat > /etc/profile.d/PHE_function.sh << "EOF" functionrm { echo"" echo"Your current host is : $(hostname)" echo"Your current directory is : $PWD" echo"You are abount to do the following: $(/usr/bin/which rm)$@" echo"Are you sure (enter HOSTNAME to proceed)?" read sure if [ $sure == "$(uname -n)" ]; then $(/usr/bin/which rm) "$@" else echo"Cancelled." fi }
functionmv { echo"" echo"Your current host is : $(hostname)" echo"Your current directory is : $PWD" echo"You are abount to do the following: $(/usr/bin/which mv)$@" echo"Are you sure (enter HOSTNAME to proceed)?" read sure if [ $sure == "$(uname -n)" ]; then $(/usr/bin/which mv) "$@" else echo"Cancelled." fi }
function umount { echo"" echo"Your current host is : $(hostname)" echo"Your current directory is : $PWD" echo"You are abount to do the following: $(/usr/bin/which umount)$@" echo"Are you sure (enter HOSTNAME to proceed)?" read sure if [ $sure == "$(uname -n)" ]; then $(/usr/bin/which umount) "$@" else echo"Cancelled." fi } EOF