[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: BASH Shell Script: Variable zerlegen



Am 2007-01-19 12:51:10, schrieb Markus Wetzel:
> Hallo NG!
> 
> Ich versuche gerade mir ein Script zu schreiben, dass vom User die 
> Eingabe einer eMail-Adresse verlangt (z.B. test@domain.com) und in einer 
> Variable speichert. Intern soll diese Variable dann zerlegt werden, so 
> dass ich eine neue Variable mit Username (test) und eine mit der Domain 
> (domain.com) erhalte.

INPUT="linux4michelle@freenet.de"

USERNAME=$(echo "${INPUT}" |cut -d '@' -f1)
DOMAIN=$(echo "${INPUT}" |cut -d '@' -f2)

Thanks, Greetings and nice Day
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSM LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)

Attachment: signature.pgp
Description: Digital signature


Reply to: