I want to override the docker
command so that when I do docker ps
or docker service ls
exactly it will render in the format I want.
I started with this
docker() {
if [ "$*" == 'ps' ]
then
command docker ps --format "table {{.Names}}\t{{.Image}}\t{{.Status}}"
else
eval "command docker $*"
# eval "command docker $@"
# command docker $*
# command docker $@
# command docker "$*"
fi
}
However when I did it this does not work
docker service ls --format="table {{.Name}}\t{{.Image}}\t{{.Replicas}}\t{{.Ports}}"
But
command docker service ls --format="table {{.Name}}\t{{.Image}}\t{{.Replicas}}\t{{.Ports}}"
It appears to be because of the "
characters being processed.