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…
>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