Today I Learned

hashrocket A Hashrocket project

Bash true!

We needed to inspect that a return code made it back from docker's exec command today.

docker exec -it <docker-container> "true" && echo "TRUE"

Will print TRUE

docker exec -it <docker-container> "! true" && echo "WONT GET PRINTED"

Won't print anything! Return codes FTW. "true" returns 0. "! true" returns 1.

See More #command-line TILs