Echoing the last command run in Bash?

Bash has built in features to access the last command executed. But that’s the last whole command (e.g. the whole case command), not individual simple commands like you originally requested. !:0 = the name of command executed. !:1 = the first parameter of the previous command !:4 = the fourth parameter of the previous command … Read more

How to create User/Database in script for Docker Postgres

EDIT – since Jul 23, 2015 The official postgres docker image will run .sql scripts found in the /docker-entrypoint-initdb.d/ folder. So all you need is to create the following sql script: init.sql CREATE USER docker; CREATE DATABASE docker; GRANT ALL PRIVILEGES ON DATABASE docker TO docker; and add it in your Dockerfile: Dockerfile FROM library/postgres … Read more