Fix regexp match.
This commit is contained in:
parent
5c6cb80047
commit
ecfcfd7776
1 changed files with 1 additions and 1 deletions
|
|
@ -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."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue