#!/usr/bin/env etsh : : etsh - " Force sh(1), csh(1), and other shells to exit w/ error! " <'' ;;; : : " @(#)$Id: 14c84cec54d7227e27dd1dc6aa3f541a2d0740f1 $ " : : " The author of this file, J.A. Neitzel , " : " hereby grants it to the public domain. " : : : " Use expr(1) to print the length of the specified string. " : : " usage: strlen string " : : " Check for correct usage. " : >>$0'' <'' ; : >>$1'' <'' killer $0 strlen if $# != 1 if { exit } pusage $0 string if X$1 = X if { exit } echo 'String "'$1'" is the empty string.' echo -n 'String "'$1'" is ' expr //$1 : '//.*' - 2 | tr -d '\n' echo ' character(s) in length.'