Sponsored Content
Top Forums Shell Programming and Scripting read -p "prompt text" foo say "read: bad option(s)" in Bourne-Shell Post 302281064 by wiseguy on Wednesday 28th of January 2009 06:12:21 AM
Old 01-28-2009
I have an other Problem with this read command:
(Even thats not a problem with read, I ask anyway in this thread)

When i make inputs (bechaue of a read command) I cant use curser direction (left oder right), or I want to make a backspace, I get some signes like this:
Backspace => ^?
left => ^[[D
right => ^[[C
Delete => ^[[3~
Pos1 => ^[[1~
End => ^[[4~

Can anybody tell me what I have to do in the script before the read command, that the user can use this keys, two?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to request a "read" or "delivered" receipt for mails

Dears, I've written a script which allows me to send mails in different formats with different attaches. Now I still want to add a feature to this script. My users would like to be able to receive a "read" or "delivered" receipt for their mails. The script send mails on behalve of an specific... (1 Reply)
Discussion started by: plelie2
1 Replies

2. UNIX for Dummies Questions & Answers

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

3. UNIX for Advanced & Expert Users

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

4. Shell Programming and Scripting

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

5. UNIX for Dummies Questions & Answers

the meaning of "!:*" in "alias foo 'command\!:*' filename"

Hi: How can I remove my own post? Thanks. (2 Replies)
Discussion started by: phil518
2 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

Purpose of "read" and "$END$" in ksh ?

Hi, Could anyone please shed some light on the following script lines and what is it doing as it was written by an ex-administrator? cat $AMS/version|read a b verno d DBVer=$(/usr/bin/printf "%7s" $verno) I checked that the cat $AMS/version command returns following output: ... (10 Replies)
Discussion started by: dbadmin100
10 Replies

8. Shell Programming and Scripting

Read from "list1" and list matches in "list2"

I want to print any matching IP addresse in List1 with List 2; List 1 List of IP addresses; 161.85.58.210 250.57.15.129 217.23.162.249 74.76.129.101 30.221.177.237 3.147.200.59 170.58.142.64 127.65.109.33 150.167.242.146 223.3.20.186 25.181.180.99 2.55.199.32 (3 Replies)
Discussion started by: lewk
3 Replies

9. 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

10. Shell Programming and Scripting

Failure: if grep "$Var" "$line" inside while read line loop

Hi everybody, I am new at Unix/Bourne shell scripting and with my youngest experiences, I will not become very old with it :o My code: #!/bin/sh set -e set -u export IFS= optl="Optl" LOCSTORCLI="/opt/lsi/storcli/storcli" ($LOCSTORCLI /c0 /vall show | grep RAID | cut -d " "... (5 Replies)
Discussion started by: Subsonic66
5 Replies
getch(3XCURSES) 					  X/Open Curses Library Functions					   getch(3XCURSES)

NAME
getch, wgetch, mvgetch, mvwgetch - get a single-byte character from the terminal SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int getch(void); int wgetch(WINDOW *win); int mvgetch(int y, int x); int mvwgetch(WINDOW *win, int y, int x); PARAMETERS
win Is a pointer to the window associated with the terminal from which the character is to be read. y Is the y (row) coordinate for the position of the character to be read. x Is the x (column) coordinate for the position of the character to be read. DESCRIPTION
These functions read a single-byte character from the terminal associated with the current or specified window. The results are unspecified if the input is not a single-byte character. If keypad(3XCURSES) is enabled, these functions respond to the pressing of a function key by returning the corresponding KEY_ value defined in <curses.h> Processing of terminal input is subject to the general rules described on the keypad(3XCURSES) manual page. If echoing is enabled, then the character is echoed as though it were provided as an input argument to addch(3XCURSES), except for the fol- lowing characters: <backspace> The input is interpreted as follows: unless the cursor already was in column 0, <backspace> moves the cursor one column toward the start of the current line and any characters after the <backspace> are added or inserted starting there. The character at the resulting cursor position it then deleted as though delch(3XCURSES) were called, except that if the cur- sor was originally in the first column of the line, the user is alerted as though beep(3XCURSES) were called. Function keys The user is alerted as though beep() were called. Information concerning the function keys is not returned to the caller. If the current or specified window is not a pad, and it has been moved modified since the last refresh operation, then it will be refreshed before another character is read. Constant Values for Function Keys The following is a list of tokens for function keys that are returned by the getch() set of functions if keypad handling is enabled (some terminals may not support all tokens). +-----------------------------------------------------------+ | Constant Description | +-----------------------------------------------------------+ |KEY_BREAK Break key | |KEY_DOWN The down arrow key | |KEY_UP The up arrow key | |KEY_LEFT The left arrow key | |KEY_RIGHT The right arrow key | |KEY_HOME Home key | |KEY_BACKSPACE Backspace | |KEY_F0 Function keys. Space for 64 keys is | | reserved. | |KEY_F(n) For 0 <= n <= 63 | |KEY_DL Delete line | |KEY_IL Insert line | |KEY_DC Delete character | |KEY_IC Insert char or enter insert mode | |KEY_EIC Exit insert char mode | |KEY_CLEAR Clear screen | |KEY_EOS Clear to end of screen | |KEY_EOL Clear to end of line | |KEY_SF Scroll 1 line forward | | KEY_SR Scroll 1 line backwards | |KEY_NPAGE Next page | |KEY_PPAGE Previous page | |KEY_STAB Set tab | |KEY_CTAB Clear tab | |KEY_CATAB Clear all tabs | |KEY_ENTER Enter or send | |KEY_SRESET Soft (partial) reset | |KEY_RESET Reset or hard reset | |KEY_PRINT Print or copy | |KEY_LL Home down or bottom (lower left) | |KEY_A1 Upper left of keypad | |KEY_A3 Upper right of keypad | |KEY_B2 Center of keypad | |KEY_C1 Lower left of keypad | |KEY_C3 Lower right of keypad | |KEY_BTAB Back tab | |KEY_BEG Beginning key | |KEY_CANCEL Cancel key | |KEY_CLOSE Close key | |KEY_COMMAND Cmd (command) key | |KEY_COPY Copy key | |KEY_CREATE Create key | |KEY_END End key | |KEY_EXIT Exit key | |KEY_FIND Find key | |KEY_HELP Help key | |KEY_MARK Mark key | |KEY_MESSAGE Message key | |KEY_MOVE Move key | |KEY_NEXT Next object key | |KEY_OPEN Open key | |KEY_OPTIONS Options key | |KEY_PREVIOUS Previous object key | |KEY_REDO Redo key | |KEY_REFERENCE Reference key | |KEY_REFRESH Refresh key | |KEY_REPLACE Replace key | |KEY_RESTART Restart key | |KEY_RESUME Resume key | |KEY_SAVE Save key | |KEY_SBEG Shifted beginning key | |KEY_SCANCEL Shifted cancel key | |KEY_SCOMMAND Shifted command key | |KEY_SCOPY Shifted copy key | |KEY_SCREATE Shifted create key | |KEY_SDC Shifted delete char key | |KEY_SDL Shifted delete line key | |KEY_SELECT Select key | |KEY_SEND Shifted end key | |KEY_SEOL Shifted clear line key | |KEY_SEXIT Shifted exit key | |KEY_SFIND Shifted find key | |KEY_SHELP Shifted help key | |KEY_SHOME Shifted home key | |KEY_SIC Shifted input key | |KEY_SLEFT Shifted left arrow key | |KEY_SMESSAGES Shifted messages key | |KEY_SMOVE Shifted move key | |KEY_SNEXT Shifted next key | |KEY_SOPTIONS Shifted options key | |KEY_SPREVIOUS Shifted previous key | |KEY_SPRINT Shifted print key | |KEY_SREDO Shifted redo key | |KEY_SREPLACE Shifted replace key | |KEY_SRIGHT Shifted right arrow key | |KEY_SRSUME Shifted resume key | |KEY_SSAVE Shifted save key | |KEY_SSUSPEND Shifted suspend key | |KEY_SUNDO Shifted undo key | |KEY_SUSPEND Suspend key | |KEY_UNDO Undo key | +-----------------------------------------------------------+ RETURN VALUES
Upon successful completion, these functions return the single-byte character, KEY_ value, or ERR. When in the nodelay mode and no data is available, ERR is returned. ERRORS
No errors are defined. USAGE
Applications should not define the escape key by itself as a single-character function. When using these functions, nocbreak mode (cbreak(3XCURSES)) and echo mode (echo(3XCURSES)) should not be used at the same time. Depending on the state of the terminal when each character is typed, the application may produce undesirable results. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
cbreak(3XCURSES), echo(3XCURSES), halfdelay(3XCURSES), keypad(3XCURSES), libcurses(3XCURSES), nodelay(3XCURSES), notimeout(3XCURSES), raw(3XCURSES), timeout(3XCURSES), attributes(5), standards(5) SunOS 5.11 5 Jun 2002 getch(3XCURSES)
All times are GMT -4. The time now is 11:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy