Author Archives: mark

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

Burn a CD/DVD ISO image file from the command line using wodim

Install wodim; its name is derived from Write data to Optical DIsk Media. This utility has many options; in a simple setup it figures out what you want to do and does it. To burn an ISO image file, first … Continue reading

Posted in Sysadmin | Comments Off on Burn a CD/DVD ISO image file from the command line using wodim

Fun with hdparm!

The hdparm utility reports on and set device parameters. This blog explains a few of the hdparm options—see the man page for more options and details. CAUTION: You can wreak havoc on a disk with some hdparm commands. You can … Continue reading

Posted in Hard disk, Sysadmin | Comments Off on Fun with hdparm!