12-04-2001
getting input from perl
Hi,
i have just tried something in perl
#!/path/to/perl
print "login: ";
$login = <STDIN>;
print "\npassword: ";
$password = <STDIN>;
print "Username=$login\n";
print "Password=$password\n";
And it doesnt work, anyone know how i can get more than one line?
Cheers,
Elfyn
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am completely new to perl and am just going over the tutorials right now. What I am trying to attempt is to take the input from the HTML (in a form) and use those variables in a perl script. I've looked everywhere for a simple example on how to do this and cannot find it or do not understand... (5 Replies)
Discussion started by: douknownam
5 Replies
2. Shell Programming and Scripting
I would like to use the WWW::Mechanize module to access a webpage that is password-protected. I was wondering if there was a way to make the input silent when asked from the script. For example:
What is your password: <password>
Where <password> is where you put your password, but is silent... (2 Replies)
Discussion started by: eightysix
2 Replies
3. Shell Programming and Scripting
I need to process a file line-by-line using some value from a shell variable
Something like:perl -p -e 's/$shell_srch/$shell_replace/g' input.txt
I can't make the '-s' work in the '-p' or '-n' input loop (or couldn't find a syntaxis.)
I have searched and found... (4 Replies)
Discussion started by: alex_5161
4 Replies
4. Shell Programming and Scripting
Hi, I am beginner perl input I just want to know if I want to make a program that let user input a function such as input " < value " List all files that are less than value The current directory is used. eg input " < 5" list all file that less than 5 in current directory until user input "quit"
... (4 Replies)
Discussion started by: guidely
4 Replies
5. Shell Programming and Scripting
If I want all user input to start with " : " if not display error
or what I asking is how to do if statement that control a first letter of string that we want to start with. and not worry about the rest
Thank (1 Reply)
Discussion started by: guidely
1 Replies
6. Shell Programming and Scripting
Please tell me how to write a perl script that asks the user to enter words and that passes them to a variable.
In bash, the "read" command would achieve such user interaction.
#!/bin/bash
read -p "Enter files: " vFiles
However, I am looking for perl version of something equivalent... (2 Replies)
Discussion started by: LessNux
2 Replies
7. Shell Programming and Scripting
Hello Experts,
I am learning perl. I know ksh/bash/csh...
In ksh I use to do this way... to read user input in silent mode so that nothing returns on the screen.
stty -echo
read -r pswd
stty echo
Please let me know the way in perl how to do it.
Here are my OS and Perl Details...
... (3 Replies)
Discussion started by: explorer007
3 Replies
8. Shell Programming and Scripting
I am executing a command it is returning me something like this
name ip port
------------------------------------
http-listener-1 * 6712
http-listener-2 * 8709
I have a subroutine getListenerName($porttobeChecked)
This subroutine returns me the name of the listener if i pass a... (4 Replies)
Discussion started by: javaholics
4 Replies
9. Shell Programming and Scripting
Hello friends . I am newbie to perl scripting but still managed to write a code but i am stuck at a place where i need help . Below is the code and can someone help me in taking user input for changing the font size for a html table .Thank you in advance
#!/bin/ksh
echo " Enter the Directory... (4 Replies)
Discussion started by: ajayram_arya
4 Replies
10. Shell Programming and Scripting
I am creating a bash that uses perl . The below code closes before the input is entered. If I run the perl as a .pl it is fine. What am I doing wrong? Thank you :).
#!/bin/bash
cd 'C:\Users\cmccabe\Desktop\wget'
wget -O getCSV.txt http://xxx.xx.xxx.xxx/data/getCSV.csv
print... (4 Replies)
Discussion started by: cmccabe
4 Replies
CHSH(1) User Commands CHSH(1)
NAME
chsh - change login shell
SYNOPSIS
chsh [options] [LOGIN]
DESCRIPTION
The chsh command changes the user login shell. This determines the name of the user's initial login command. A normal user may only change
the login shell for her own account; the superuser may change the login shell for any account.
OPTIONS
The options which apply to the chsh command are:
-h, --help
Display help message and exit.
-s, --shell SHELL
The name of the user's new login shell. Setting this field to blank causes the system to select the default login shell.
If the -s option is not selected, chsh operates in an interactive fashion, prompting the user with the current login shell. Enter the new
value to change the shell, or leave the line blank to use the current one. The current shell is displayed between a pair of [ ] marks.
NOTE
The only restriction placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the superuser,
and then any value may be added. An account with a restricted login shell may not change her login shell. For this reason, placing /bin/rsh
in /etc/shells is discouraged since accidentally changing to a restricted shell would prevent the user from ever changing her login shell
back to its original value.
FILES
/etc/passwd
User account information.
/etc/shells
List of valid login shells.
/etc/login.defs
Shadow password suite configuration.
SEE ALSO
chfn(1), login.defs(5), passwd(5).
User Commands 06/24/2011 CHSH(1)