What shell am I in?

When you connect to a system, whether directly on the system’s keyboard or through a remote connection you will automatically start in your default shell. The default shell was originally assigned to you when your account was created.

To find out what shell you are currently using we can use the echo command:

$ echo $SHELL
/bin/bash

In this command we are using the echo command to examine the value of the environment variable $SHELL. This variable was set by the system when we started this command line session and shows the full path to the shell we were assigned at login. Here are some common shells you might see:

  • /bin/sh – Bourne shell
  • /bin/bash – Bourne Again shell
  • /bin/csh – C shell
  • /bin/ksh – Korn shell
  • /bin/tcsh – TC shell
  • /bin/zsh – Z shell

Shell binaries are also commonly found in the /usr/local/bin directory. Consult your system administrator if you’re having trouble finding your shell binaries.

Oracle Shell ScriptingFor more information like this check out my book Oracle Shell Scripting, only $34.95 from Rampant TechPress.

Buy it now!


Oracle Shell Scripting, another review

Another review for my book Oracle Shell Scripting: Linux and UNIX Programming for Oracle has shown up on Amazon!

Prashant wrote:

This book has helped me impress my colleagues and boss..I originally browsed through it at Border’s (and found myself sitting on the ground with a notepad scrambling to copy as much as possible)..of course, then I realized I had to have it, so I bought it online..I knew the publisher was a trustworthy source because I’m always using Don Burleson’s DBA tips online.. this author’s approach is easy-to-follow and concise; yet it’s a thorough guide that is like a catalyst for your own creativity…it has made me look forward to extracting the power of the shell.

It’s a lot better than parsing through thick UNIX encyclopedias or cycling through fragmented online material..as an OCP 10g/9i DBA, I still feel like there are not enough practical day-to-day guides like this one for junior/mid/senior-level administrators, since over half our work is directly/indirectly connected to the shell.

Thanks for the great review Prashant! After all the work that goes into a book like this it’s great to know that it’s helping people. That’s what it’s all about, after all.

Oracle Shell ScriptingFor more information like this check out my book Oracle Shell Scripting, only $34.95 from Rampant TechPress.

Buy it now!


Oracle Shell Scripting: First Review on Amazon.com

Last week my book, Oracle Shell Scripting: Linux and UNIX Programming for Oracle got its first review on Amazon.com:

Here’s Mike Bennett’s complete review from Amazon:

I’m a veteran Oracle Database Administrator and most of my work is on Unix systems so I wasn’t sure how much information in this book would be useful to me. I was pleasantly surprised to find what a wide range of scripting tips and techniques this manual provides. I was impressed by the fact that the author didn’t just describe HOW to do something, but also explained WHY a particular approach was taken. I also like the fact that the scripts given aren’t just contrived samples, but are practical and useful as given. This information will definitely help simplify some of my routine tasks and provide me with timely information about the environments and systems I work with. The author also pointed out how to go beyond what was provided in the book by suggesting ways the examples might be modified. I’ve already taken advantage of that with a script I helped one of my clients develop.

Thanks to Mike for the great review! I’m glad he found the book useful and I hope others do as well. If you have my book I welcome your feedback and encourage you to post your own review on Amazon!

Oracle Shell ScriptingFor more information like this check out my book Oracle Shell Scripting, only $34.95 from Rampant TechPress.

Buy it now!


When to use shell scripts

With my new book “Oracle Shell Scripting” now on shelves you may be wondering what shell scripting can do for you. Below is an excerpt from the book that touches on when you may want to think about scripting. While the book is geared toward Oracle users much of the content would apply to shell scripting regardless of the use.

When to script

A shell script can be written to do anything you would do at the command line. So when do you want to write a shell script? When is it a bad idea? Well, here are a few guidelines I use.

Shell scripts can yield the biggest return on regular tasks that are performed more-or-less the same way each time. If every day you log into a system and remove some files out of a directory, backup a database or check a log file for a specific string of characters you should automate these tasks. Chances are you can make them run automatically and save yourself the hassle all together.

Shell scripts aren’t just for automation though. In some cases a script saves us time in a different way by allowing us to run a simple command instead of a very complicated one.

One of the most powerful features of the shell and shell scripting is the ability to affect several files and even multiple servers with a single script. Loops and commands like find make shell scripting ideal for managing large numbers of files in a single step.

In general there is little point in writing a shell script to do something once. The exception to this is occasionally something needs to be run at a time when you would rather not have to be around to run it yourself. In this case you may decide to bundle those commands into a shell script and schedule it to run without you involved. Be careful with this type of script and always be thinking “what if something goes wrong?” because sooner or later it will and if you’re not around to fix it you could get in some hot water.

Oracle Shell ScriptingFor more information like this check out my book Oracle Shell Scripting, only $34.95 from Rampant TechPress.

Buy it now!


shell script, unix, linux, oracle, bash, scripting

Oracle Shell Scripting available on Amazon.com

Oracle Shell ScriptingMy book Oracle Shell Scripting: Linux and UNIX Programming for Oracle has just become available on Amazon.com!

The book has been out for just a couple weeks and should be in book stores soon, but it can be had online right now! The best price on the book right now can be found at Rampant TechPress who is currently selling the book for $34.95. Amazon is currently selling the book at the cover price of $49.95.


unix, oracle, shell scripting, linux, book, database tuning, database administration, database security