#!/bin/ksh
echo -n "enter the 1 to convert lower to upper or 2 convert upper to lower"
read n
echo -in_str "Enter the string here"
read in_str
echo $n
echo $in_str
if [ $n -eq 1 ] then
$ echo $in_str| awk '{print toupper($0)}'
elif [ -n -eq 2 ] then
$ echo $in_str| awk '{print tolower($0)}'
else
echo "please select the correct choice"
fi
四處錯誤:別人意想不到的我無法運行上面的代碼無法運行UNIX Shell腳本
awk的替代方法是'typeset -u in_str'和'tr'[:upper:]''[:lower:]'' – 2014-09-08 07:24:53