Sponsored Content
Top Forums Shell Programming and Scripting read -n1 -r -p "Press..." key / produces error in bash shell script Post 302424755 by linuxinho on Wednesday 26th of May 2010 08:23:25 AM
Old 05-26-2010
read -n1 -r -p "Press..." key / produces error in bash shell script

Hello!

Sorry, for my not so perfect english!

I want to stop bash shell script execution until any key is pressed.

This line in a bash shell script

Code:
read -n1 -r -p "Press any key to continue..." key

produces this error

Quote:
read: 1: Illegal option -n
When I run this from the command line

Code:
usera@lynx:~$ read -n1 -r -p "Press any key to continue..." key
usera@lynx:~$

it works without error.

What do I wrong?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to include RETURN KEY with Background process "&" in Shell Script

Hello All, I am a newbie in Shell script programming, and maybe you can help me with my query. I need to write a shell script (mntServer.ksh) that will start a background process and also to be able to run another script. The mntServer.ksh script contains: #!/bin/ksh... (1 Reply)
Discussion started by: racbern
1 Replies

2. Shell Programming and Scripting

How does BASH handle KEY BOARD "up arrow"??

hello sir, I am studying the BASH shell. I was wondering how the BASH is able to handle the "up arrow" key to give the commands that were previously typed by us. Can you please tell me the code to do such an operation. I want to handle more such keys and put KEY BOARD short cuts to the BASH shell. (1 Reply)
Discussion started by: nsharath
1 Replies

3. Shell Programming and Scripting

read -p "prompt text" foo say "read: bad option(s)" in Bourne-Shell

Hallo, i need a Prompting read in my script: read -p "Enter your command: " command But i always get this Error: -p: is not an identifier When I run these in c-shell i get this error /usr/bin/read: read: bad option(s) How can I use a Prompt in the read command? (9 Replies)
Discussion started by: wiseguy
9 Replies

4. Shell Programming and Scripting

"Join" or "Merge" more than 2 files into single output based on common key (column)

Hi All, I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations: 1. I am restrained to 2 input files only. 2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
Discussion started by: Katabatic
1 Replies

5. Shell Programming and Scripting

speeding up bash script with "while read line"

Hello everybody, I'm still slowly treading my way into bash scripting (without any prior programming experience) and hence my code is mostly what some might call "creative" if they meant well :D I have created a script that serves its purpose but it does so very slowly, since it needs to work... (4 Replies)
Discussion started by: origamisven
4 Replies

6. Shell Programming and Scripting

Shell script using expect to login to couple of remote servers and read "crontab -l"

I need a shell script using expect to login to couple of remote servers and read "crontab -l -u <username>" & "cat /etc/rc.local" & "df -h" and able to create output into a file saved locally with hostname.crontab & hostname.rc.local & disk.status. I can supply a file as list of hostname or IP... (4 Replies)
Discussion started by: jaipsharma
4 Replies

7. UNIX for Dummies Questions & Answers

"Help with bash script" - "License Server and Patch Updates"

Hi All, I'm completely new to bash scripting and still learning my way through albeit vey slowly. I need to know where to insert my server names', my ip address numbers through out the script alas to no avail. I'm also searching on how to save .sh (bash shell) script properly.... (25 Replies)
Discussion started by: profileuser
25 Replies

8. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

9. Shell Programming and Scripting

Script that automatically issue "yes" and press enter

Team, Got a thousand servers. I created a script to say hello on every server. But is there a script or whatever that will issue a yes on every key checking. for i in `cat myserverlist` do echo $i ssh-copy-id $i done The authenticity of host 'server1 (162.162.0.10)' can't be... (7 Replies)
Discussion started by: invinzin21
7 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
COROSYNC-KEYGEN(8)					      System Manager's Manual						COROSYNC-KEYGEN(8)

NAME
corosync-keygen - Generate an authentication key for Corosync. SYNOPSIS
corosync-keygen [-l] DESCRIPTION
If you want to configure corosync to use cryptographic techniques to ensure authenticity and privacy of the messages, you will need to generate a private key. corosync-keygen creates this key and writes it to /etc/corosync/authkey. This private key must be copied to every processor in the cluster. If the private key isn't the same for every node, those nodes with nonmatching private keys will not be able to join the same configuration. Copy the key to some security transportable storage or use ssh to transmit the key from node to node. Then install the key with the command: unix#: install -D --group=0 --owner=0 --mode=0400 /path_to_authkey/authkey /etc/corosync/authkey If a message "Invalid digest" appears from the corosync executive, the keys are not consistent between processors. Note: corosync-keygen will ask for user input to assist in generating entropy unless the -l option is used. OPTIONS
-l Use a less secure random data source that will not require user input to help generate entropy. This may be useful when this utility is used from a script. EXAMPLES
Generate the key. $ corosync-keygen Corosync Cluster Engine Authentication key generator. Gathering 1024 bits for key from /dev/random. Press keys on your keyboard to generate entropy. SEE ALSO
corosync_overview(8), corosync.conf(5), AUTHOR
Angus Salkeld 2010-05-30 COROSYNC-KEYGEN(8)
All times are GMT -4. The time now is 03:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy