1 year ago

#39133

test-img

LaFllamme

Terminal Settings: Replace error message of alias

Wassup Guys,

I have made a few aliases inside my terminal settings for some handy commands. However, one of the aliases is using docker and when the docker engine is not started, it prints the following error: (Obivously I do not always use docker when I use the terminal)

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

errormsg

My question is, if I can edit my alias inside my .zshrc settings so I can print something else instead this of this long message? Like a Simple hello. Below are my settings: GNU nano 2.0.6 File: .zshrc

alias kill="docker kill $(docker ps -q) || print Wassup G"
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'
export PATH="$HOME/.pyenv/bin:$PATH"
export PATH="/usr/local/bin:$PATH"
export PATH="$(pyenv root)/shims:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/bzip2/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include"

enter image description here

linux

macos

terminal

zshrc

aliases

0 Answers

Your Answer

Accepted video resources