≡ Menu


How do I determine if a function called foo() is already defined in a bash script or not? If a function called foo() is defined just call it or show an error message?
[click to continue…]

HowTo: Linux / UNIX Unset TMOUT ( AutoLogOut )

I've set the the TMOUT in the ~/.profile of the user account as well as in /etc/profile file on my UNIX or Linux servers. How do I unset the TMOUT variable? How to unset TMOUT temporarily under UNIX like operating systems?
[click to continue…]

Bash Shell Script Function Examples

How do I create a shell script function using Bash under UNIX / Linux operating systems?
[click to continue…]

Q. I’m using BASH shell filename tab completion feature to complete file names and other stuff. However default tab-completion in bash case-sensitive. It cannot show me /tmp/Y* or /tmp/Y* files. How do I force filename tab-completion in bash case insensitive?

A. According to bash man page completion-ignore-case set to Off. If set to On, readline performs filename matching and completion in a case-insensitive fashion. Readline has variables that can be used to further customize its behavior. A variable may be set in the /etc/inputrc file with a statement of the form. So all you have to do is type following command:
$ set completion-ignore-case on

You need to add set completion-ignore-case on to /etc/inputrc command:
vi /etc/inputrc
Append text as follows:
set completion-ignore-case on
Close and save the file. For more information read bash man page.

Linux / UNIX source Command Examples

How do I use source command under UNIX / Linux / BSD / OS X operating systems?
[click to continue…]

How do I change the color of my shell prompt under Linux or Unix operating systems?
[click to continue…]