shell 脚本
#!/bin/sh
# func2.sh
char_name()
# char_name
# to call: char_name string
# check if $1 does indeed contain only characters a-z,A-Z
{
# assign the argument across to new variable
_LETTERS_ONLY=$1
_LETTERS_ONLY=`echo $1 | awk '{if($0~/[^a-zA-Z]/) print "1"}'`
if [ "$_LETTERS_ONLY" != "" ]
then
# oops errors
return 1
else
# contains only chars
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余3页未读,立即下载