While loop password creation problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting While loop password creation problem
# 1  
Old 03-27-2009
While loop password creation problem

#!/bin/bash
#Filename: Assignment Author: Luke Francis
quit=n
while [ "$quit" = "n" ]
do
clear
echo "OPERATOR ADMINISTRATIVE TOOL"
clear
echo "1. User Information"
echo "2. Network Connectivity"
echo "3. Processes"
echo "4. System Information"
echo "5. Hardware Utilization"
echo "Which option do you require?"
read menunumber
case $menunumber in
1) echo "USER INFORMATION"
echo "1. Registered Users"
echo "2. Disk Usage"
echo "3. Last Logins"
echo "Q.Quit"
echo "Which option do you require?"
read menunumber2
case $menunumber2 in
1) awk -F: '{print $1}' /etc/passwd
echo "Hit the Enter Key to continue"
read junk;;
2) du
echo "Hit Enter Key to continue"
read junk;;
3) who
echo "Hit Enter Key to continue"
read junk;;
Q|q) quit=y;;
*) echo "INCORRECT PASSWORD"


I have managed to get this working, but only at the cost of removing my password entry statement. My statement was as follows:

read password
if [ $password -eq 0600519 ]
then
clear


How can i now implement this so it still functions the same but in the while loop.
# 2  
Old 03-27-2009
Quote:
Originally Posted by warlock129
#!/bin/bash
#Filename: Assignment Author: Luke Francis

Please put code inside [code] tags.

Please post the minimum complete script that demonstrates the problem.
# 3  
Old 03-28-2009
What i want to know is what code must i implement to allow a user to login after entering password of 0600519 when prompted at "OPERATOR ADMISTRATIVE TOOL" screen. Where should i place it as previous attempts have failed.
# 4  
Old 03-28-2009
Quote:
Originally Posted by warlock129
What i want to know is what code must i implement to allow a user to login after entering password of 0600519 when prompted at "OPERATOR ADMISTRATIVE TOOL" screen.

There is no prompt to enter a password in the script you posted.
Quote:
Where should i place it as previous attempts have failed.

Where do you want it? Where does it logically belong?

Please re-read my previous post.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash directory loop and order by creation date?

Hello, how in bash i can get directory loop and order by creation date? THX! :) #!/bin/bash for folder in /home/test/* do if ; then echo $folder; fi (12 Replies)
Discussion started by: ZerO13
12 Replies

2. Shell Programming and Scripting

File system creation script on AIX 6.1 using while loop

#!/bin/sh echo "VG: " read VG echo "LP: " read LP echo "SAP: " read SAP echo "NUM: " read NUM echo "SID: " read SID while ]; read VG LP SAP NUM SID ; do mklv -y $SAP$NUM -t jfs2 -e x $VG $LP; crfs -v jfs2 -d /dev/$SAP$NUM -m /oracle/$SID/$SAP$NUM ... (14 Replies)
Discussion started by: arorap
14 Replies

3. Programming

File creation problem

I am creating a file to store data, but the file does not get created at all. #include <unistd.h> #define DEFAULT_ID 0 int main() { int d, n=0; int sz, data=0; char fn; char *bv; snprintf(fn, 256, "bv", DEFAULT_ID); bv=fn; printf("%s\n", bv); if ((d =... (4 Replies)
Discussion started by: powyama
4 Replies

4. UNIX for Advanced & Expert Users

Can we Automate the User creation and setting password through a script in solaris 10

Hi, I am using Solaris 10 OS and Bash shell.Is there any way can we automate User creation and setting passwords through a script or any freeware tool. Advance thanks for your response. (1 Reply)
Discussion started by: muraliinfy04
1 Replies

5. AIX

User creation problem

Hi, I am getting tired in creating several users in a day. Can anyone have a script to create several users in the same server, as well as, to create one user in several servers. where i have to put script and how to run the script. Waiting for your reply. Thanks in advance (5 Replies)
Discussion started by: udtyuvaraj
5 Replies

6. Shell Programming and Scripting

file creation inside loop

i=1 while do touch TC$i.txt i=`expr $1 + 1` done echo "files created successfully" What is wrong with code...its running continuosly... (4 Replies)
Discussion started by: villain41
4 Replies

7. Solaris

File creation problem

Hi to all, I am facing a strange problem on the Solaris-10 server. I am unable to create/write files on the server. After writing, when I go for the save, then it gives me and 'jag: I/O error'..where 'jag' is a file name. Please suggest me... Regards, Jagdish Machhi (2 Replies)
Discussion started by: jagdish.machhi@
2 Replies

8. Shell Programming and Scripting

Directory Creation problem

Hiiii, here is my script-- BackupLocation="$OPTARG" if ]; then echo "Either option l or L should be given to $Programname" echo "$Usage" echo "$Programname is terminated" ... (1 Reply)
Discussion started by: namishtiwari
1 Replies

9. Shell Programming and Scripting

problem with link creation!!!!

I have a home directory namely /pto/ppa/ridbmw/etl/ Now i have various directorys below the home directory. For eg from the home directory if i say cd /roddata it changes to that directory. I think its kind of link (I don't know if it's hard or soft). Now i need to create a new directory and... (4 Replies)
Discussion started by: dsravan
4 Replies

10. News, Links, Events and Announcements

Password Creation Site - Feedback

Hi, I created a new site called http://www.goodpassword.com to help users and adminstrators create good, random passwords. It also includes .htaccess encryption. I'd be interested in feedback ie errors, improvements, additions etc. thanks DJay (0 Replies)
Discussion started by: djay
0 Replies
Login or Register to Ask a Question