Home » Tag Archives: bash

Tag Archives: bash

Docker Trick: Running Containers Efficiently Using A Bash Script

One of the basic problems with running a docker image is that its too easy to spew up multiple instances or containers of the same image. Consider running the following container for instance: docker run -it -e AWS_ACCESS_KEY_ID="test" -e AWS_SECRET_ACCESS_KEY="test" \ --net=host "prahladyeri/testimage:latest" /bin/bash This will start a fresh container instance from image prahladyeri/testimage:latest and you may optionally pass environment ...

Read More »

Bash If – Statement Example

This is an If – Condition Example. Sometimes you need to specify different courses of action to be taken in a shell script, depending on the success or failure of a command. The if construction allows you to specify such conditions.                   The most compact syntax of the if command is: if ...

Read More »