Script to ask for password to reenter the sys

November 14, 2010 at 18:07:50
Specs: unix shell
Hello, can some1 please help me, I cant seem to get it to work properly
[code]#!/bin/sh
clear
trap "" INT
echo ""
ORIGINAL_DIGEST='echo H | md5sum'
while [ 1 ]
do
echo "Enter Pasword"
read USERINPUT
DIGEST='echo $USERINPUT | md5sum
if [$DIGEST = $ORIGINAL_DIGEST]
then
echo "Welcome back user"
exit
else
echo "Try again"
fi
done
[/code] It keeps telling me "line 11: [echo $USERINPUT | md5sum = echo 666 | md5sum] command not found and i dont understand what it wants. Thank you to any1 who helps

See More: Script to ask for password to reenter the sys

Report •

#1
November 14, 2010 at 21:56:37
are you missing a tick ` or ' at the end of line 11?

you have:
DIGEST='echo $USERINPUT | md5sum

should it be:
DIGEST='echo $USERINPUT | md5sum'


Report •

#2
November 15, 2010 at 07:36:13
thank you, that was it

Report •

#3
November 15, 2010 at 07:37:56
glad I could help.

Report •
Related Solutions


Ask Question