Dejan Grujin <DGrujin(at)b-o-p.de> wrote:
> wie teste ich in einem shell-script, ob bei einer Benutzereingabe ein string
> mit einem kleinen oder großen Buchstaben anfängt?
>
> Also nicht den kompletten string überprüfen sondern im Prinzip nur den
> ERSTEN Buchstaben vom String.
#!/bin/sh -
echo -n "Gib irgendwas ein: "
read BLABLA
case "$BLABLA" in
[a-z]*)
echo "Kleiner Buchstabe am Anfang."
;;
[A-Z]*)
echo "Großer Buchstabe am Anfang."
;;
*)
echo "Kein Buchstabe am Anfang."
;;
esac
Gruß
Olli
-- Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "All that we see or seem is just a dream within a dream" (E. A. Poe) To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org with "unsubscribe de-bsd-questions" in the body of the messageReceived on Wed 29 Aug 2001 - 13:34:29 CEST