Handle wrapper for shell builtins

This commit is contained in:
Nathan Broadbent
2012-08-16 01:42:56 +12:00
parent 8bef4be5b3
commit 81f9d9260c

View File

@@ -208,8 +208,12 @@ if [ "$shell_command_wrapping_enabled" = "true" ] || [ "$bash_command_wrapping_e
unset -f $cmd unset -f $cmd
# Create wrapped alias for old function # Create wrapped alias for old function
alias "$cmd"="exec_scmb_expand_args __original_$cmd";; alias "$cmd"="exec_scmb_expand_args __original_$cmd";;
*'is a shell builtin'*)
*) # Otherwise, command is a regular script or binary that can be aliased # Handle shell builtin commands
alias $cmd="exec_scmb_expand_args builtin $cmd";;
*)
# Otherwise, command is a regular script or binary,
# and the full path can be found from 'which'
alias $cmd="exec_scmb_expand_args $(\which $cmd)";; alias $cmd="exec_scmb_expand_args $(\which $cmd)";;
esac esac
done done