Re: Editing in VI

From: Renison, Rick (rick.renison@EDS.COM)
Date: Fri Sep 20 2002 - 14:22:58 EDT


The following gives you a start. Have fun ;)

x="asdkjhKJH38fdjns%\$_@jkfhk" #string to validate

echo $x
r=${x#*@} # right side
echo $r
l="${x%@*}" # left side
echo $l
if [ "$a" = "$b" ]
then
  echo "missing @ sign"
fi
# remove good characters characters, digits, and "_" character
a=`echo "$l"|tr -d "[a-zA-Z0-9_]"`
if [ -z "$a" ]
then
  echo "all characters OK"
else
  echo "characters <$a> illegal"
fi

-----Original Message-----
From: Dana Jaeger [mailto:jaeger@HARTHOSP.ORG]
Sent: September 20, 2002 11:10
To: aix-l@Princeton.EDU
Subject: Editing in VI

Hi,

I have a need to edit an entry via a kron shell script.
Input would be - nnnnnnnn@domain.name

a) nnnnnnnn can be letters and/or numbers, special characters and be any
                   length, uppercase or lower case .
b) domain.name could be any length before and after the dot.
                 example valied entries are A) harthosp.org
                                             B) ibm.com
                                             C) myname.ibm.com
c) @ must be present

This will be entered as a response to a question from an korn shell script
      echo "`hostname`: Enter the email address where you wish to have the
output sent"
      read emailaddress

What would the syntax be to edit for for this?

Can anyone help? Thanks in advance

Dana Jaeger
Hartford Hospital
jaeger@harthosp.org



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:13 EDT