Is it possible to have multiple aliases for the same bash function without have to redefine the content of the function across multiple aliases ?
You'll just have to define the alias for it rather than having multiple function declarations with the same body:
# attach a bash shell to a running docker container
function dexb {
docker exec -it "$1" /bin/bash
}
# attach a sh shell to a running docker container
function dexs {
docker exec -it "$1" /sh
}
# Now instead of creating another function say 'dex' with the same
# content as the function 'dexb'
# I'll just create an alias
alias 'dex'='dexb'
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments