if [ "$name" == "abcd" -a "$password" == "pwd" ]; then echo true; else echo false; fi
This and MANY more "basic" questions can be answered quickly and without the need for a forum-post with the command man bash on most systems; and if it's not there just google "man bash" and pick the one which seems closest to your system... they're all "pretty much the same", especially at the basic level.
Cheers. Keith.
EDIT: FWW: the [ ] construct is a short-cut for "test", a function which is built-into all the the "standard" shells (sh, csh, ksh, and bash)... so the following code is EXACTLY equivalent:
$ a=a
$ b=c
$ if test "$a" = "a" && test "$b" = "c"; then echo true; else echo false; fi
true
The if then construct just evaluates the return value from the test function. You can display the return value of your last shell command with $?... but beware, echo also sets $?:
$ true
$ echo $?
0
$ false
$ echo $?
1
$ echo $?
0
The really interesting ramification of that is that the if then construct can evaluate anything which returns success=0=true or failure=anything BUT 0 (typically 1=false)... be that a shell built-in function, a user-defined function, a unix utility or a program you wrote yourself. Hence the following code is roughly equivalent:
$ if echo "$a:$b" | fgrep -s "a:c"; then echo true; else echo false; fi
a:c
true
NOTE: looks like my system's fgrep doesn't accept the -s for silent switch. Sigh.
Note that in above example, where the output from echo is being piped to the standard fgrep utility, it is the return value of fgrep (the LAST command to be invoked) which is evaluated by if then.
Good luck, and may root be with you. Cheers again. Keith.