Sponsored Content
Top Forums Shell Programming and Scripting enter key or carriage return as input in perl Post 302532748 by doubando on Wednesday 22nd of June 2011 04:01:05 AM
Old 06-22-2011
Error enter key or carriage return as input in perl

hi experts

Question in perl
i'm creating a script to take from user a different inputs one of them is the carriage return .. so that i want to make an if condition if the user hit enter key the user will go to previous step

it something like that
Code:
chomp ($input = <STDIN>);
if ($input =~ /\n/)
{
goto previous;
}

i tried /r /n and both with no hope !

what the pattern i must match to detect the enter key from the user ?

thanks
Ahmed Douban

Last edited by pludi; 06-22-2011 at 06:27 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Pressing backspace key simulates enter key

Hi, Whenever i press the backspace key, a new line appears, i.e. it works like a enter key. :confused: Thanks (2 Replies)
Discussion started by: vibhor_agarwali
2 Replies

2. Shell Programming and Scripting

Perl - How to print a "carriage return" to an output file?

Let's say I want to write a program that run these 4 UNIX commands and redirect output to a file. #!/usr/local/bin/perl use strict; `cd \$HOME > output.txt`; `cut -f1 inputfile.txt >> output.txt`; `hostname >> output.txt`; `ifconfig >> output.txt`; I want to print a "carriage return"... (5 Replies)
Discussion started by: teiji
5 Replies

3. Shell Programming and Scripting

BASH: Any Way to Get User Input Without Requiring Them to Hit the Enter Key?

I'm working on making a menu system on an HP-UX box with Bash on it. The old menu system presents the users with a standard text menu with numbers to make selections. I'm re-working the system and I would like to provide something more akin to iterative search in Emacs. I have a list of 28... (2 Replies)
Discussion started by: deckard
2 Replies

4. UNIX for Dummies Questions & Answers

carriage return and linefeed

hi can anyone please tell me the difference between carriage return, linefeed and newline ? (2 Replies)
Discussion started by: streetfi8er
2 Replies

5. Shell Programming and Scripting

How to enter a return key in bash script?

Hi, I'm porting an install script from AIX to Red Hat (2.6.18-164.el5 #1 SMP) I have this script working in both AIX and HP-UX. The script is a wrapper for a Micro Focus Server Express install program. It responds to the install program questions with a here-now list. Responses includes... (14 Replies)
Discussion started by: duker61
14 Replies

6. Shell Programming and Scripting

2 carriage return within a record

Hi all, need your help in replacing carriage return in a record. Input: col1|col2|col3|col4|col5|col6|col7|col8|col9|col10 1|aa|bb|cc|dd|eee eee|ff|ggggg|hh hhh|iii 2|zz|yy|xx|ww|vv|uu|tt|ss|rr Output: col1|col2|col3|col4|col5|col6|col7|col8|col9|col10... (12 Replies)
Discussion started by: agathaeleanor
12 Replies

7. Shell Programming and Scripting

function terminating if i give input as space or no input and enter

HI i have written a script to ask input from the user. this script should promote the user for y/n input. if user enters anyother input then y/n the script promotes him again. this below code is working fine for all the cases. except for space and enter " if i give space and enter it is... (2 Replies)
Discussion started by: BHASKARREDDY006
2 Replies

8. Shell Programming and Scripting

Perl - start search by using search button or by pressing the enter key

#Build label and text box $main->Label( -text => "Input string below:" )->pack(); $main->Entry( -textvariable => \$text456 )->pack(); $main->Button( -text => "Search", -command => sub { errchk ($text456) ... (4 Replies)
Discussion started by: popeye
4 Replies

9. Shell Programming and Scripting

Loop logic, enter into respective IF as per enter input file name

have three big data file, however I just need to see the mentioned below one line form the all the file which has SERVER_CONNECTION Value File 1 export SERVER_CONNECTION=//dvlna002:10001/SmartServer File2 export SERVER_CONNECTION=///SmartServer File3 export... (1 Reply)
Discussion started by: Nsharma3006
1 Replies

10. UNIX for Dummies Questions & Answers

Enter carriage return in xml file after each tag (> sign)

I have an xml file which is generated in a single line an looks like this <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?><Batch_Id="1999996" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><some data....><some data....>closing lines...... I need to have a separate line... (3 Replies)
Discussion started by: vx04
3 Replies
scamp(8)						      System Manager's Manual							  scamp(8)

Name
       scamp - System Configuration and Management Program

Syntax
       /usr/etc/scamp

Description
       The  utility  is a menu-driven program that helps you set up and manage your system.  scamp allows you to manage user accounts and software
       subsets, and to perform basic system management tasks such as setting the system date and time, and rebooting the system.

       uses the directory to store all of it's files.

Restrictions
       This utility is installed in the directory.  To have access to while in single-user mode the partition must be mounted.

Examples
       When is invoked a page of welcome text first displayed.	After you hit a carriage return the Main Menu is displayed.

		       *****************************
			 ULTRIX  SCAMP	MAIN  MENU
		       *****************************

		       1 - User Account Management
		       2 - Network Setup Information
		       3 - Terminal Setup
		       4 - Modem Setup
		       5 - Printer Setup
		       6 - Install/Remove Software Subsets
		       7 - License Management Facility - LMF
		       8 - System Management Services

		       0 - Exit

		       Enter your choice:
       At the 'Enter your choice:' prompt you enter the number that is beside the task you would like to perform.  To enter a  Product	Authoriza-
       tion Key (PAK) you use the 'License Management Facility - LMF' menu item, so you would enter a 7 at the prompt.

       Each  of  the  Main  Menu items have one or more screenfulls of information that could be displayed.  To exit to the previous screen, or to
       exit the utility when at Main Menu, enter a 0 at the prompt.

Files
See Also
       Guide to SCAMP

																	  scamp(8)
All times are GMT -4. The time now is 06:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy