This is tree-ish contents listing script, which outputs the contents recursively.
keep_listing.sh $path
| #!/bin/bash | |
| list_recursive () | |
| { | |
| local filepath=$1 | |
| local indent=$2 | |
| echo "${indent}${filepath##*/}" | |
| if [ -d "$filepath" ]; then | |
| local fname | |
| _IFS=$IFS | |
| IFS=$'\n' | |
| for fname in $(ls "$filepath") | |
| do | |
| list_recursive "${filepath}/${fname}" " $indent" | |
| done | |
| IFS=$_IFS | |
| fi | |
| } | |
| list_recursive "$1" " " |