How do I make the following function work correctly
# Install git on demand
function git()
{
if ! type git &> /dev/null; then sudo $APT install git; fi
git $*;
}
by making git $*
call /usr/bin/git
instead of the function git()
?
|
Like this:
The Further, I added the You may want to consider what to do in case of error (e.g., when |
|||||
|
Or perhaps a more generic function being able to run any command. In this case the '-f' can be replaced with '-t'. The collision with the function will not occur.
Of course 'apt-get install' errors must be handled. |
|||||
|