How it works...

  1. We are creating bash scripts to check the version of a database and to create a new database. In these scripts, we are using the root user and there is a password present right after -p for that user. You can use the root user or else you can create a new user, assign a password to it, and use that user in your scripts.
  2. SQLite software provides us with a simple command-line interface. Using this interface, we can manually enter and execute SQL commands. You can list the database using the dot (.) operator. .databases and .tables are used to list all the tables in the database.
  3. In PostgreSQL, first we are changing the user from student to postgres. Then, we enter psql to start the postgres command-line console. In that console, ...

Get Bash Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.