Fix regexp match.

This commit is contained in:
Alexander Boström 2012-05-22 12:23:16 +02:00
commit ecfcfd7776

View file

@ -8,7 +8,7 @@ while : ; do
read U
# Make sure it does not start with a "-" and only contains valid
# username characters.
if [[ "$U" =~ "^[A-Za-z0-9_][A-Za-z0-9_-]*\$" ]]; then
if [[ "$U" =~ ^[A-Za-z0-9_][A-Za-z0-9_-]*$ ]]; then
ssh "$U@localhost"
else
echo "Bad username."