Tag Info

Hot answers tagged

2

You're invoking ksh. The kind of substitution you are wanting to do works only since ksh '93. Is there a chance you are using an older version? Run ksh and check for the existence of KSH_VERSION. If it doesn't exist or is before '93, it's too old.


1

It would be more efficient to rewrite this, thereby avoiding the issue in the first place: #!/bin/ksh get_file_totals() { if [ -e "$file_name" ] then cut -c4-7 "$file_name" else echo "error" # consider stderr by appending >&2 fi } file_name="$1" get_file_totals



Only top voted, non community-wiki answers of a minimum length are eligible