hi all,
I'm using the getpwnam method of the pwd library and in it, it has a passwd struct. A member of this struct is called char *pw_shell. When I call getpwnam("simanek" I am returned a passwd struct that i call pw. Now, I'm trying to see if my shell is /bin/ksh (which it is) but for some reason, I cannot compare them. The following is my 'if' statement for comparison.
if(pw->pw_shell == "/bin/ksh"
this fails no matter what i do. However, when I do printf(pw->pw_shell) "/bin/ksh" (no quotes) is printed to my console. Any ideas?
Thanks. Mike
~~~~
simanek@uiuc.edu
"It's a Swingline!"
~~~~
I'm using the getpwnam method of the pwd library and in it, it has a passwd struct. A member of this struct is called char *pw_shell. When I call getpwnam("simanek" I am returned a passwd struct that i call pw. Now, I'm trying to see if my shell is /bin/ksh (which it is) but for some reason, I cannot compare them. The following is my 'if' statement for comparison.
if(pw->pw_shell == "/bin/ksh"
this fails no matter what i do. However, when I do printf(pw->pw_shell) "/bin/ksh" (no quotes) is printed to my console. Any ideas?
Thanks. Mike
~~~~
simanek@uiuc.edu
"It's a Swingline!"
~~~~