Skip to main content

Posts

Showing posts with the label bash

Advanced Bash-Scripting Guide

An in-depth exploration of the art of shell scripting. This guide assumes no previous knowledge of scripting or programming, but progresses rapidly toward an intermediate/advanced level of instruction . . . all the while sneaking in little nuggets of UNIX® wisdom and lore. It serves as a textbook, a manual for self-study, and a reference and source of knowledge on shell scripting techniques. The exercises and heavily-commented examples invite active reader participation, under the premise that the only way to really learn scripting is to write scripts. This book is also suitable for classroom use as a general introduction to programming concepts. The Advanced Bash Scripting Guide is both a reference and a tutorial on shell scripting. This comprehensive book (the equivalent of 974 print pages) covers almost every aspect of shell scripting. It contains 364 profusely commented illustrative examples, a number of tables, and a cross-linked index/glossary. Not just a shell ...

Execution Sequence of .bash_* files

Execution sequence for interactive login shell execute /etc/profile IF ~/.bash_profile exists THEN execute ~/.bash_profile ELSE IF ~/.bash_login exist THEN execute ~/.bash_login ELSE IF ~/.profile exist THEN execute ~/.profile END IF END IF END IF When you logout of the interactive shell, following is the sequence of execution: IF ~/.bash_logout exists THEN execute ~/.bash_logout END IF Please note that /etc/bashrc is executed by ~/.bashrc as shown below: # cat ~/.bashrc if [ -f /etc/bashrc ]; then . /etc/bashrc Fi Execution sequence for interactive non-login shell While launching a non-login interactive shell, following is the sequence of execution: IF ~/.bashrc exists THEN execute ~/.bashrc END IF