Category Archives: bash

Use := to Assign a Default Value to an Unset Variable

You can change the value of a null or unset variable to its default in a script using the := modifier: ${name:=default} When the shell expands the expression ${name:=default}, it sets the value of name to the expanded value of … Continue reading

Posted in bash, Shell scripts | Comments Off on Use := to Assign a Default Value to an Unset Variable

Performing a Join from the Command Line

The examples in this section use the following files: $ cat one 9999 first line file one. aaaa second line file one. cccc third line file one. $ cat two aaaa FIRST line file two. bbbb SECOND line file two. … Continue reading

Posted in bash, Sysadmin | Comments Off on Performing a Join from the Command Line

What does dereference mean?

A symbolic link is a file that refers to another file (a target file) without pointing directly to the target file: It is a reference to the target file. To dereference a symbolic link means to follow the link to … Continue reading

Posted in bash, Sysadmin, Uncategorized | Comments Off on What does dereference mean?

The local Builtin

You can use the local builtin only within a function. This builtin causes its arguments to be local to the function it is called from and its children. Without local, variables declared in a function are available to the shell … Continue reading

Posted in bash, Sysadmin | Comments Off on The local Builtin