ShellTree 6: Further Optimization by Removing Changes to IFS

This post is part of an educational series on building a shell script to graphically display the structure of a directory. Previously We broke down Dem Pilafian’s one line command to display a tree of a directory We broke down Dem Pilafian’s script that uses the one line command We modified the one line to…

Bash: Passing Whitespace as Parameters to Functions

This post will deal with how to pass whitespace as a parameter to a function in bash shell scripting. Pre-requisites Understanding bash whitespace quotation and backslash escaped characters Understanding IFS and how to modify it and its effects Setup Let’s make a shell script. In your favourite editor type #!/bin/bash And save it somewhere as…

Bash IFS: its Definition, Viewing it and Modifying it

When writing a bash shell script it is important to understand how IFS (Internal Field Separtor) works and how it can be modified/changed. What is IFS As mentioned in the man bash pages IFS is defined as follows: IFS The Internal Field Separator that is used for word splitting after expansion and to split lines…

ShellTree 5: Optimizing the Recursive Script by Removing Arrays and Adding a String

This post is part of an educational series on building a shell script to graphically display the structure of a directory. Previously We broke down Dem Pilafian’s one line command to display a tree of a directory We broke down Dem Pilafian’s script that uses the one line command We modified the one line to…