Thanks for all the responses! The most popular (and easiest) way to extract the last argument passed to a ksh script is: eval lastarg=\${$#} $# == the total number of arguments