0

I am trying to create an alias for this docker command:

docker ps -a --format="table {{ .Names }} \t {{ .Image }} \t {{ .Status }} \t {{ .Ports }}"

I'm using zsh so I added this to my .zshrc file:

alias dockerps = 'docker ps -a --format="table {{ .Names }} \\t {{ .Image }} \\t {{ .Status }} \\t {{ .Ports }}"'

I' ve also tried escaping the double quotes \", but every time I try to finish with the compile

. ~/.zshrc

it results in

/home/USER/.zshrc:129: bad assignment

EDIT: removing the spaces around alias : alias dockerps = xx... --> alias dockerps=xx... fixed it

wiseboar
  • 56
  • 3
  • 1
    Please use code formatting and show us **exactly** what you have put in your .zshrc. Is the space around `=` in the alias intentional? – muru Sep 15 '20 at 06:49
  • ok, I used code formatting and copied exactly the line of code from the .zshrc file the space is not intentional, I just removed it and will try – wiseboar Sep 15 '20 at 07:14
  • ok, removing the spaces solved it :D – wiseboar Sep 15 '20 at 07:15

0 Answers0