annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/gettext/user-email @ 68:5028fdace37b

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 16:23:26 -0400
parents
children
rev   line source
jpayne@68 1 #!/bin/sh
jpayne@68 2 # Prints the user's email address, with confirmation from the user.
jpayne@68 3 #
jpayne@68 4 # Copyright (C) 2001-2003, 2005, 2013 Free Software Foundation, Inc.
jpayne@68 5 #
jpayne@68 6 # This program is free software: you can redistribute it and/or modify
jpayne@68 7 # it under the terms of the GNU General Public License as published by
jpayne@68 8 # the Free Software Foundation; either version 3 of the License, or
jpayne@68 9 # (at your option) any later version.
jpayne@68 10 #
jpayne@68 11 # This program is distributed in the hope that it will be useful,
jpayne@68 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
jpayne@68 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
jpayne@68 14 # GNU General Public License for more details.
jpayne@68 15 #
jpayne@68 16 # You should have received a copy of the GNU General Public License
jpayne@68 17 # along with this program. If not, see <https://www.gnu.org/licenses/>.
jpayne@68 18
jpayne@68 19 # Prerequisites for using ${exec_prefix}/lib and ${datarootdir}/locale.
jpayne@68 20 prefix="/mnt/c/Users/crash/Documents/BobLiterman/CSP2_Galaxy/CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce"
jpayne@68 21 exec_prefix="${prefix}"
jpayne@68 22 datarootdir="${prefix}/share"
jpayne@68 23 datadir="${datarootdir}"
jpayne@68 24 # Set variables libdir, localedir.
jpayne@68 25 libdir="${exec_prefix}/lib"
jpayne@68 26 localedir="${datarootdir}/locale"
jpayne@68 27
jpayne@68 28 # Support for relocatability.
jpayne@68 29 if test "no" = yes; then
jpayne@68 30 orig_installdir="$libdir"/gettext # see Makefile.am's install rule
jpayne@68 31 # Determine curr_installdir without caring for symlinked callers.
jpayne@68 32 curr_installdir=`echo "$0" | sed -e 's,/[^/]*$,,'`
jpayne@68 33 curr_installdir=`cd "$curr_installdir" && pwd`
jpayne@68 34 # Compute the original/current installation prefixes by stripping the
jpayne@68 35 # trailing directories off the original/current installation directories.
jpayne@68 36 while true; do
jpayne@68 37 orig_last=`echo "$orig_installdir" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
jpayne@68 38 curr_last=`echo "$curr_installdir" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
jpayne@68 39 if test -z "$orig_last" || test -z "$curr_last"; then
jpayne@68 40 break
jpayne@68 41 fi
jpayne@68 42 if test "$orig_last" != "$curr_last"; then
jpayne@68 43 break
jpayne@68 44 fi
jpayne@68 45 orig_installdir=`echo "$orig_installdir" | sed -e 's,/[^/]*$,,'`
jpayne@68 46 curr_installdir=`echo "$curr_installdir" | sed -e 's,/[^/]*$,,'`
jpayne@68 47 done
jpayne@68 48 # Now relocate the directory variables that we use.
jpayne@68 49 libdir=`echo "$libdir/" | sed -e "s%^${orig_installdir}/%${curr_installdir}/%" | sed -e 's,/$,,'`
jpayne@68 50 localedir=`echo "$localedir/" | sed -e "s%^${orig_installdir}/%${curr_installdir}/%" | sed -e 's,/$,,'`
jpayne@68 51 fi
jpayne@68 52
jpayne@68 53 # Internationalization.
jpayne@68 54 . gettext.sh
jpayne@68 55 TEXTDOMAIN=gettext-tools
jpayne@68 56 export TEXTDOMAIN
jpayne@68 57 TEXTDOMAINDIR="$localedir"
jpayne@68 58 export TEXTDOMAINDIR
jpayne@68 59
jpayne@68 60 # Redirect fileno 3 to interactive I/O.
jpayne@68 61 exec 3>/dev/tty
jpayne@68 62
jpayne@68 63 # Output a prompt.
jpayne@68 64 if test $# != 0; then
jpayne@68 65 echo "$1" 1>&3
jpayne@68 66 fi
jpayne@68 67
jpayne@68 68 # Find the user name on the local machine.
jpayne@68 69 user=`id -u -n 2>/dev/null`
jpayne@68 70 if test -z "$user"; then
jpayne@68 71 user="$USER"
jpayne@68 72 if test -z "$user"; then
jpayne@68 73 user="$LOGNAME"
jpayne@68 74 if test -z "$user"; then
jpayne@68 75 user=unknown
jpayne@68 76 fi
jpayne@68 77 fi
jpayne@68 78 fi
jpayne@68 79
jpayne@68 80 # Find the hostname.
jpayne@68 81 # hostname on some systems (SVR3.2, old Linux) returns a bogus exit status,
jpayne@68 82 # so uname gets run too, so we keep only the first line of output.
jpayne@68 83 #host=`(hostname || uname -n) 2>/dev/null | sed 1q`
jpayne@68 84 host=`"$libdir"/gettext/hostname --short 2>/dev/null | sed 1q`
jpayne@68 85
jpayne@68 86 # Find the hostname.
jpayne@68 87 hostfqdn=`"$libdir"/gettext/hostname --fqdn 2>/dev/null | sed 1q`
jpayne@68 88
jpayne@68 89 # Find a list of email addresses from various mailer configuration files.
jpayne@68 90 # All mailers use configuration files under $HOME. We handle them in a
jpayne@68 91 # last-modified - first-priority order.
jpayne@68 92 cd $HOME
jpayne@68 93 files=""
jpayne@68 94
jpayne@68 95 # ----------------------- BEGIN MAILER SPECIFIC CODE -----------------------
jpayne@68 96
jpayne@68 97 # Mozilla Thunderbird addresses
jpayne@68 98 files="$files .thunderbird/*/prefs.js"
jpayne@68 99
jpayne@68 100 # Mozilla addresses
jpayne@68 101 files="$files .mozilla/*/prefs.js"
jpayne@68 102
jpayne@68 103 # Netscape 4 addresses
jpayne@68 104 files="$files .netscape/liprefs.js .netscape/preferences.js"
jpayne@68 105
jpayne@68 106 # Netscape 3 addresses
jpayne@68 107 files="$files .netscape/preferences"
jpayne@68 108
jpayne@68 109 # Emacs/XEmacs rmail, Emacs/XEmacs gnus, XEmacs vm addresses
jpayne@68 110 # XEmacs mew addresses
jpayne@68 111 files="$files .emacs .emacs.el"
jpayne@68 112
jpayne@68 113 # KDE2 addresses
jpayne@68 114 files="$files .kde2/share/config/emaildefaults"
jpayne@68 115
jpayne@68 116 # KDE kmail addresses
jpayne@68 117 files="$files .kde2/share/config/kmailrc"
jpayne@68 118
jpayne@68 119 # GNOME evolution 2 addresses
jpayne@68 120 files="$files .gconf/apps/evolution/mail/%gconf.xml"
jpayne@68 121
jpayne@68 122 # GNOME evolution 1 addresses
jpayne@68 123 files="$files evolution/config.xmldb"
jpayne@68 124
jpayne@68 125 # GNOME balsa addresses
jpayne@68 126 files="$files .gnome/balsa"
jpayne@68 127
jpayne@68 128 # StarOffice and OpenOffice addresses
jpayne@68 129 sed_dos2unix='s/\r$//'
jpayne@68 130 sed_soffice51='s,StarOffice 5\.1=\(.*\)$,\1/sofficerc,p'
jpayne@68 131 sed_soffice52='s,StarOffice 5\.2=\(.*\)$,\1/user/sofficerc,p'
jpayne@68 132 sed_ooffice='s,^OpenOffice[^=]*=\(.*\)$,\1/user/config/registry/instance/org/openoffice/UserProfile.xml,p'
jpayne@68 133 files="$files Office51/sofficerc Office52/user/sofficerc "`sed -n -e "$sed_dos2unix" -e "$sed_soffice51" -e "$sed_soffice52" -e "$sed_ooffice" .sversionrc 2>/dev/null | sed -e 's,^file://*,/,'`
jpayne@68 134
jpayne@68 135 # mutt addresses
jpayne@68 136 files="$files .muttrc"
jpayne@68 137
jpayne@68 138 # pine addresses
jpayne@68 139 files="$files .pinerc"
jpayne@68 140
jpayne@68 141 # xfmail addresses
jpayne@68 142 files="$files .xfmail/.xfmailrc"
jpayne@68 143
jpayne@68 144 # tkrat addresses
jpayne@68 145 files="$files .ratatosk/ratatoskrc"
jpayne@68 146
jpayne@68 147 # ----------------------- END MAILER SPECIFIC CODE -----------------------
jpayne@68 148
jpayne@68 149 # Expand wildcards and remove nonexistent files from the list.
jpayne@68 150 nfiles=""
jpayne@68 151 for file in $files; do
jpayne@68 152 if test -r "$file" && test ! -d "$file"; then
jpayne@68 153 nfiles="$nfiles $file"
jpayne@68 154 fi
jpayne@68 155 done
jpayne@68 156 files="$nfiles"
jpayne@68 157
jpayne@68 158 addresses=""
jpayne@68 159
jpayne@68 160 if test -n "$files"; then
jpayne@68 161
jpayne@68 162 for file in `ls -t $files`; do
jpayne@68 163
jpayne@68 164 case "$file" in
jpayne@68 165
jpayne@68 166 # ----------------------- BEGIN MAILER SPECIFIC CODE -----------------------
jpayne@68 167
jpayne@68 168 # Mozilla and Mozilla Thunderbird addresses
jpayne@68 169 .mozilla/*/prefs.js | .thunderbird/*/prefs.js)
jpayne@68 170 addresses="$addresses "`grep -h '^user_pref("mail\.identity\..*\.useremail", ".*");$' $file 2>/dev/null | sed -e 's/^user_pref("mail\.identity\..*\.useremail", "\(.*\)");$/\1/'`
jpayne@68 171 ;;
jpayne@68 172
jpayne@68 173 # Netscape 4 addresses
jpayne@68 174 .netscape/liprefs.js | .netscape/preferences.js)
jpayne@68 175 addresses="$addresses "`grep -h '^user_pref("mail\.identity\.useremail", ".*");$' $file 2>/dev/null | sed -e 's/^user_pref("mail\.identity\.useremail", "\(.*\)");$/\1/'`
jpayne@68 176 ;;
jpayne@68 177
jpayne@68 178 # Netscape 3 addresses
jpayne@68 179 .netscape/preferences)
jpayne@68 180 addresses="$addresses "`grep -h '^EMAIL_ADDRESS:' $file 2>/dev/null | sed -e 's/^EMAIL_ADDRESS:[ ]*//'`
jpayne@68 181 ;;
jpayne@68 182
jpayne@68 183 .emacs | .emacs.el)
jpayne@68 184 # Emacs/XEmacs rmail, Emacs/XEmacs gnus, XEmacs vm addresses
jpayne@68 185 addresses="$addresses "`grep -h '[ (]user-mail-address "[^"]*"' $file 2>/dev/null | sed -e 's/^.*[ (]user-mail-address "\([^"]*\)".*$/\1/'`
jpayne@68 186 # XEmacs mew addresses
jpayne@68 187 domains=`grep -h '[ (]mew-mail-domain "[^"]*"' $file 2>/dev/null | sed -e 's/^.*[ (]mew-mail-domain "\([^"]*\)".*$/\1/'`
jpayne@68 188 if test -n "$domains"; then
jpayne@68 189 for domain in $domains; do
jpayne@68 190 addresses="$addresses ${user}@$domain"
jpayne@68 191 done
jpayne@68 192 fi
jpayne@68 193 ;;
jpayne@68 194
jpayne@68 195 # KDE2 addresses
jpayne@68 196 .kde2/share/config/emaildefaults)
jpayne@68 197 addresses="$addresses "`grep -h '^EmailAddress=' $file 2>/dev/null | sed -e 's/^EmailAddress=//'`
jpayne@68 198 ;;
jpayne@68 199
jpayne@68 200 # KDE kmail addresses
jpayne@68 201 .kde2/share/config/kmailrc)
jpayne@68 202 addresses="$addresses "`grep -h '^Email Address=' $file 2>/dev/null | sed -e 's/^Email Address=//'`
jpayne@68 203 ;;
jpayne@68 204
jpayne@68 205 # GNOME evolution 2 addresses
jpayne@68 206 .gconf/apps/evolution/mail/%gconf.xml)
jpayne@68 207 sedexpr0='s,^.*&lt;addr-spec&gt;\(.*\)&lt;/addr-spec&gt;.*$,\1,p'
jpayne@68 208 addresses="$addresses "`sed -n -e "$sedexpr0" < $file`
jpayne@68 209 ;;
jpayne@68 210
jpayne@68 211 # GNOME evolution 1 addresses
jpayne@68 212 evolution/config.xmldb)
jpayne@68 213 sedexpr0='s/^.*<entry name="identity_address_[0-9]*" type="string" value="\([^"]*\)".*$/\1/p'
jpayne@68 214 sedexpr1='s/\(..\)/\\x\1/g'
jpayne@68 215 sedexpr2='s,$,\\n,'
jpayne@68 216 addresses="$addresses "`sed -n -e "$sedexpr0" < $file | while read hexstring; do printf \`echo "$hexstring" | sed -e "$sedexpr1" -e "$sedexpr2"\`; done`
jpayne@68 217 ;;
jpayne@68 218
jpayne@68 219 # GNOME balsa addresses
jpayne@68 220 .gnome/balsa)
jpayne@68 221 addresses="$addresses "`grep -h '^Address=' $file 2>/dev/null | sed -e 's/^Address=//'`
jpayne@68 222 ;;
jpayne@68 223
jpayne@68 224 # OpenOffice addresses
jpayne@68 225 */UserProfile.xml)
jpayne@68 226 addresses="$addresses "`sed -n -e 's,^.*<mail cfg:type="string">\(.*\)</mail>.*$,\1,p' $file 2>/dev/null`
jpayne@68 227 ;;
jpayne@68 228
jpayne@68 229 # StarOffice addresses
jpayne@68 230 # Not a typo. They really write "Adress" with a single d.
jpayne@68 231 # German orthography...
jpayne@68 232 */sofficerc)
jpayne@68 233 addresses="$addresses "`grep -h '^User-Adress=' $file 2>/dev/null | sed -e 's/#[^#]*$//' -e 's/^.*#//'`
jpayne@68 234 ;;
jpayne@68 235
jpayne@68 236 # mutt addresses
jpayne@68 237 .muttrc)
jpayne@68 238 mutt_addresses=`grep -h '^set from="[^"]*"[ ]*$' $file 2>/dev/null | sed -e 's/^set from="\([^"]*\)"[ ]*$/\1/'`
jpayne@68 239 if test -n "$mutt_addresses"; then
jpayne@68 240 addresses="$addresses $mutt_addresses"
jpayne@68 241 else
jpayne@68 242 # mutt uses $EMAIL as fallback.
jpayne@68 243 if test -n "$EMAIL"; then
jpayne@68 244 addresses="$addresses $EMAIL"
jpayne@68 245 fi
jpayne@68 246 fi
jpayne@68 247 ;;
jpayne@68 248
jpayne@68 249 # pine addresses
jpayne@68 250 .pinerc)
jpayne@68 251 domains=`grep -h '^user-domain=' $file 2>/dev/null | sed -e 's/^user-domain=//'`
jpayne@68 252 if test -n "$domains"; then
jpayne@68 253 for domain in $domains; do
jpayne@68 254 addresses="$addresses ${user}@$domain"
jpayne@68 255 done
jpayne@68 256 else
jpayne@68 257 # The use-only-domain-name option is only used if the user-domain option is not present.
jpayne@68 258 domains=`grep -h '^use-only-domain-name=' $file 2>/dev/null | sed -e 's/^use-only-domain-name=//'`
jpayne@68 259 if test "Yes" = "$domains"; then
jpayne@68 260 addresses="$addresses ${user}@"`echo "$hostfqdn" | sed -e 's/^[^.]*\.//'`
jpayne@68 261 fi
jpayne@68 262 fi
jpayne@68 263 ;;
jpayne@68 264
jpayne@68 265 # xfmail addresses
jpayne@68 266 .xfmail/.xfmailrc)
jpayne@68 267 addresses="$addresses "`grep -h '^from=.*<.*>' $file 2>/dev/null | sed -e 's/^.*<\([^<>]*\)>.*$/\1/'`
jpayne@68 268 ;;
jpayne@68 269
jpayne@68 270 # tkrat addresses
jpayne@68 271 .ratatosk/ratatoskrc)
jpayne@68 272 domains=`grep -h '^set option(masquerade_as) ' $file 2>/dev/null | sed -e 's/^set option(masquerade_as) //'`
jpayne@68 273 if test -n "$domains"; then
jpayne@68 274 for domain in $domains; do
jpayne@68 275 addresses="$addresses ${user}@$domain"
jpayne@68 276 done
jpayne@68 277 else
jpayne@68 278 # The domain option is used only if the masquerade_as option is not present.
jpayne@68 279 domains=`grep -h '^set option(domain) ' $file 2>/dev/null | sed -e 's/^set option(domain) //'`
jpayne@68 280 if test -n "$domains"; then
jpayne@68 281 for domain in $domains; do
jpayne@68 282 addresses="$addresses ${user}@${host}.$domain"
jpayne@68 283 done
jpayne@68 284 fi
jpayne@68 285 fi
jpayne@68 286 ;;
jpayne@68 287
jpayne@68 288 # ----------------------- END MAILER SPECIFIC CODE -----------------------
jpayne@68 289
jpayne@68 290 esac
jpayne@68 291
jpayne@68 292 done
jpayne@68 293
jpayne@68 294 fi
jpayne@68 295
jpayne@68 296 # Some Debian systems have a file /etc/mailname.
jpayne@68 297 if test -r /etc/mailname; then
jpayne@68 298 hostmailname=`cat /etc/mailname`
jpayne@68 299 if test -n "$hostmailname"; then
jpayne@68 300 addresses="$addresses ${user}@$hostmailname"
jpayne@68 301 fi
jpayne@68 302 fi
jpayne@68 303
jpayne@68 304 # SuSE Linux >= 8.0 systems have a file /etc/sysconfig/mail.
jpayne@68 305 if test -r /etc/sysconfig/mail; then
jpayne@68 306 hostmailname=`. /etc/sysconfig/mail && echo "$FROM_HEADER"`
jpayne@68 307 if test -n "$hostmailname"; then
jpayne@68 308 addresses="$addresses ${user}@$hostmailname"
jpayne@68 309 fi
jpayne@68 310 fi
jpayne@68 311
jpayne@68 312 # elm has no user-defined addresses.
jpayne@68 313 # mailx has no user-defined addresses.
jpayne@68 314 # mh has no user-defined addresses.
jpayne@68 315 # They use the system default.
jpayne@68 316 addresses="$addresses ${user}@$hostfqdn"
jpayne@68 317
jpayne@68 318 # Normalize addresses: remove addresses without @, lowercase the part after @,
jpayne@68 319 # and remove duplicates.
jpayne@68 320 lowercase_sed='{
jpayne@68 321 h
jpayne@68 322 s/^[^@]*@\(.*\)$/\1/
jpayne@68 323 y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
jpayne@68 324 x
jpayne@68 325 s/^\([^@]*\)@.*/\1@/
jpayne@68 326 G
jpayne@68 327 s/\n//
jpayne@68 328 p
jpayne@68 329 }'
jpayne@68 330 naddresses=""
jpayne@68 331 for addr in $addresses; do
jpayne@68 332 case "$addr" in
jpayne@68 333 "<"*">") addr=`echo "$addr" | sed -e 's/^<//' -e 's/>$//'` ;;
jpayne@68 334 esac
jpayne@68 335 case "$addr" in
jpayne@68 336 *@*)
jpayne@68 337 addr=`echo "$addr" | sed -n -e "$lowercase_sed"`
jpayne@68 338 case " $naddresses " in
jpayne@68 339 *" $addr "*) ;;
jpayne@68 340 *) naddresses="$naddresses $addr" ;;
jpayne@68 341 esac
jpayne@68 342 ;;
jpayne@68 343 esac
jpayne@68 344 done
jpayne@68 345 addresses="$naddresses"
jpayne@68 346
jpayne@68 347 # Now it's time to ask the user.
jpayne@68 348 case "$addresses" in
jpayne@68 349 " "*" "*)
jpayne@68 350 # At least two addresses.
jpayne@68 351 lines=""
jpayne@68 352 i=0
jpayne@68 353 for addr in $addresses; do
jpayne@68 354 i=`expr $i + 1`
jpayne@68 355 lines="${lines}${i} ${addr}
jpayne@68 356 "
jpayne@68 357 done
jpayne@68 358 while true; do
jpayne@68 359 { gettext "Which is your email address?"; echo; } 1>&3
jpayne@68 360 echo "$lines" 1>&3
jpayne@68 361 { gettext "Please choose the number, or enter your email address."; echo; } 1>&3
jpayne@68 362 read answer < /dev/tty
jpayne@68 363 case "$answer" in
jpayne@68 364 *@*) ;;
jpayne@68 365 [0-9]*)
jpayne@68 366 i=0
jpayne@68 367 for addr in $addresses; do
jpayne@68 368 i=`expr $i + 1`
jpayne@68 369 if test "$i" = "$answer"; then
jpayne@68 370 break 2
jpayne@68 371 fi
jpayne@68 372 done
jpayne@68 373 ;;
jpayne@68 374 esac
jpayne@68 375 case "$answer" in
jpayne@68 376 "<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
jpayne@68 377 esac
jpayne@68 378 case "$answer" in
jpayne@68 379 *" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
jpayne@68 380 *@*.*) ;;
jpayne@68 381 *@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
jpayne@68 382 *) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
jpayne@68 383 esac
jpayne@68 384 addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
jpayne@68 385 break
jpayne@68 386 done
jpayne@68 387 ;;
jpayne@68 388 " "*)
jpayne@68 389 # One address.
jpayne@68 390 while true; do
jpayne@68 391 { gettext "Is the following your email address?"; echo; } 1>&3
jpayne@68 392 echo " $addresses" 1>&3
jpayne@68 393 { gettext "Please confirm by pressing Return, or enter your email address."; echo; } 1>&3
jpayne@68 394 read answer < /dev/tty
jpayne@68 395 if test -z "$answer"; then
jpayne@68 396 addr=`echo "$addresses" | sed -e 's/^ //'`
jpayne@68 397 break
jpayne@68 398 fi
jpayne@68 399 case "$answer" in
jpayne@68 400 "<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
jpayne@68 401 esac
jpayne@68 402 case "$answer" in
jpayne@68 403 *" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
jpayne@68 404 *@*.*) ;;
jpayne@68 405 *@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
jpayne@68 406 *) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
jpayne@68 407 esac
jpayne@68 408 addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
jpayne@68 409 break
jpayne@68 410 done
jpayne@68 411 ;;
jpayne@68 412 "")
jpayne@68 413 # No address.
jpayne@68 414 { gettext "Couldn't find out about your email address."; echo; } 1>&3
jpayne@68 415 while true; do
jpayne@68 416 { gettext "Please enter your email address."; echo; } 1>&3
jpayne@68 417 read answer < /dev/tty
jpayne@68 418 case "$answer" in
jpayne@68 419 "<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
jpayne@68 420 esac
jpayne@68 421 case "$answer" in
jpayne@68 422 *" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
jpayne@68 423 *@*.*) ;;
jpayne@68 424 *@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
jpayne@68 425 *) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
jpayne@68 426 esac
jpayne@68 427 addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
jpayne@68 428 break
jpayne@68 429 done
jpayne@68 430 ;;
jpayne@68 431 *) echo "internal error" 1>&3 ; exit 1 ;;
jpayne@68 432 esac
jpayne@68 433
jpayne@68 434 # Print to standard output.
jpayne@68 435 echo "$addr"