Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Docker commands (command not found)

If I use docker commands in terminal all ok, but in script do not working.
enter image description here
enter image description here
Please help!

I added – PATH="/usr/bin:$PATH" and PATH="/var/lib/docker:$PATH" but…

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Unless you want to save output of "docker ps" and "docker images" in a variable, you should just run those commands directly in the script as follows. No need to use backticks or $() for that.

#!/bin/bash
docker ps
docker images
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading