10-24-2007
Shell Program that prompts for user Id
Hi
I have a question that after trying tirelessly I cant solve. I'm not great wth UNIX and wonder if anyone could help. I have to create a shell program using functions that prompts for a user ID. I must then verify that the user Id corresponds to an account on the system. If a legal user Id is provided then the pathname of the user's home directory must be displayed. If a user ID that is not recognised is entered an error message must be displayed. Any possible solution would gbe greatly appreciated.
Thanks in advance!
10 More Discussions You Might Find Interesting
1. Solaris
I create a succesful pkgask 'response' file:
pkgask -r xyz.pkg
I then attempt to use the 'response' file with pkgadd:
pkgadd -nr /home/user/response -d /home/user/xyz.pkg
the prompts for user input still appear. I have also tried an 'admin' file but that still prompts for user input as... (1 Reply)
Discussion started by: prkfriryce
1 Replies
2. Shell Programming and Scripting
Hi,
I'm writing a script that calls a function to generate a certificate. In generating this certificate, I'm asked a series of questions. I was wondering, is there a way to pre-program my script to answer these questions in the same way all the time. I saw something like
EOF>>
y
EOF
... (4 Replies)
Discussion started by: eltinator
4 Replies
3. Shell Programming and Scripting
Hi
I have a question that after trying tirelessly I cant solve. I'm not great wth UNIX and wonder if anyone could help. I have to create a shell program using functions that prompts for a user ID. I must then verify that the user Id corresponds to an account on the system. If a legal user Id is... (16 Replies)
Discussion started by: mmg2711
16 Replies
4. UNIX for Advanced & Expert Users
Hi,
I'm curious about the advantage of forking and executing a program in a user shell as opposed to forking and executing the program directly without the user shell.
For example:
why is it often like:
SSHD->fork&exec(shell, sftp-server)->fork&exec(sftp-server)
And Not like:
... (2 Replies)
Discussion started by: seeker333
2 Replies
5. Shell Programming and Scripting
Hey guys,
I have some task from my office to lock user on the specified directory after the user logged on using ssh. And then run prompt program to fill the required information. Yeah, just like an ATM system.
My question:
How could I do those?? AFAIK I have to edit the ~./bashrc. But the... (1 Reply)
Discussion started by: franzramadhan
1 Replies
6. Shell Programming and Scripting
The script prompts the user to enter four lines. (1 Reply)
Discussion started by: polineni
1 Replies
7. Shell Programming and Scripting
I'm trying to write a script the simplifies the execution of a program:
After starting the program (sh ~/.mfix/model/make_mfix) I am prompted four times for options:
Do you need SMP version? (y/n)
Do you need DMP version? (y/n)
Do you need debug version? (y/n)
Force re-compilation of... (2 Replies)
Discussion started by: lanew
2 Replies
8. Shell Programming and Scripting
Hi, I'm writing a script,
in the script I need to use tcpdump to capture some packets
however it needs root priviledge
my computer is configured by school and I have no real root priviledge
so I can't use sudo on my computer,like
Code:
sudo tcpdump ......
I have to use a limited... (1 Reply)
Discussion started by: esolve
1 Replies
9. Shell Programming and Scripting
Hi all,
I am trying write a shell script to automate the installation of a program, but during the process of the installation, the installation program requires the user to scroll through 10 pages of a license agreement. Since this is coming from stdout and is not a prompt, I am unable to send... (4 Replies)
Discussion started by: nanlee
4 Replies
10. Shell Programming and Scripting
Good morning,
I'm attempting to call sqlldr via shell script and it is prompting endIf is unec
#!/bin/sh
cd /tmp/v_tst
FILENAME_WANTED=`date +"HourlyData_%Y%m%d_%H00.txt"`
echo "FILENAME_WANTED = ${FILENAME_WANTED}"
LIST_OF_FILES=`ls -rt HourlyData*.txt |tail -1`
LIST_OF_FILES=`basename... (4 Replies)
Discussion started by: V1l1h1
4 Replies
yppasswd(1) General Commands Manual yppasswd(1)
NAME
yppasswd, ypchfn, ypchsh - change your password in the NIS database
SYNOPSIS
yppasswd [-f] [-l] [-p] [user]
ypchfn [user]
ypchsh [user]
DESCRIPTION
In the old days, the standard passwd(1), chfn(1) and chsh(1) tools could not be used under Linux to change the users NIS password, shell
and GECOS information. For changing the NIS information, they were replaced by their NIS counterparts, yppasswd, ypchfn and ypchsh.
Today, this versions are deprecated and should not be used any longer.
Using the command line switches, you can choose whether to update your password -p, your login shell -l, or your GECOS field -f, or a com-
bination of them. yppasswd implies the -p option, if no other option is given. If you use the -f or -l option, you also need to add the -p
flag. ypchfn implies the -f option, and ypchsh -l.
When invoked without the user argument, the account information for the invoking user will be updated, otherwise that of user will be
updated. This option is only available to the super-user. If the yppasswdd daemon on the server supports it, you can give the root password
of the server instead of the users [old] password.
All tools will first prompt the user for the current NIS password needed for authentication with the yppasswdd(8) daemon. Subsequently, the
program prompts for the updated information:
yppasswd or -p
Change the user's NIS password. The user is prompted for the new password. While typing the password, echoing is turned off, so
the password does not appear on the screen. An empty password is rejected, as are passwords shorter than six characters. The user
will then be requested to retype the password to make sure it wasn't misspelled the first time.
ypchsh or -l
Change the user's login shell. The user is prompted for a new shell, offering the old one as default:
Login shell [/bin/sh]: _
To accept the default, simply press return. To clear the shell field in your passwd(5) file entry (so that the system's default
shell is selected), enter the string none.
ypchfn or -f
Change the user's full name and related information. Traditionally, some applications expect the GECOS field (field 4) of the
passwd(5) file to contain the user's real name (as opposed to the login name) plus some additional information like the office phone
number. This information is displayed by finger(1) and probably some other tools, too.
When setting the full name, ypchfn displays the following prompts, with the defaults in brackets:
Name [Joe Doe]:
Location [2nd floor, bldg 34]:
Office Phone [12345]:
Home Phone []:
To accept a default, simply press return. To clear a field, enter the string none.
SEE ALSO
chfn(1), chsh(1), finger(1), passwd(5), passwd(1), ypcat(1), yppasswdd(8), ypserv(8), ypwhich(1)
AUTHOR
yppasswd is part of the yp-tools package, which was written by Thorsten Kukuk <kukuk@linux-nis.org>.
YP Tools 2.12 April 2010 yppasswd(1)