lfn - else FILES=`ls ${filename}` for X in ${FILES} ; do...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#FILE: lfn.bash #Author: Johny Nguyen #Purpose: to determine the longest name of a file in the given directory #!/usr/bin/env bash filename=$1 maxLength=0 if [ ! -d ${filename} ]; then echo "No such directory: ${filename}"
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: else FILES=`ls ${filename}` for X in ${FILES} ; do currentLength=`expr length $X` if [ "${currentLength}" -gt "${maxLength}" ]; then maxLength=${currentLength} fi done fi...
View Full Document

Ask a homework question - tutors are online