Sponsored Content
Top Forums Shell Programming and Scripting Bash KeyPress (or Read Single Character) Post 302437172 by Ste_Moore01 on Wednesday 14th of July 2010 07:41:30 AM
Old 07-14-2010
Thanks for the quick replies

Franklin52
When I try your method I get the following errors
Code:
./test.sh: read: illegal option: -d
read: usage: read [-r] [-p prompt] [-a array] [-e] [name ...]
./test.sh: printf: illegal option: -v
printf: usage: printf format [arguments]
You have pressed ???

funksen
When I try your method I get the following errors
Code:
unknown mode: cbreak
^[[B
unknown mode: -cbreak

It appears that I don't have the read -d, printf -v and cbreak functions.

Do you know of any other ways to do this?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

read a variable character by character, substitute characters with something else

im having trouble doing this: i have a variable with 2 characters repeating e.g. aababbbaaaababaabbaabbba is there a way i can search the variable for a's and b's and then change a's to b's and b's to a's? im guessing its like getting the 1's compliment of the string im doing this in... (2 Replies)
Discussion started by: vipervenom25
2 Replies

2. Shell Programming and Scripting

read in a file character by character - replace any unknown ASCII characters with spa

Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/ Thanks! (1 Reply)
Discussion started by: raghav525
1 Replies

3. Shell Programming and Scripting

Can I read a file character by character?

Hello all respected people, Can i read a file character by character without using sed,awk and perl commands. Thanks in advance. (4 Replies)
Discussion started by: murtaza
4 Replies

4. Shell Programming and Scripting

bash while read how to remove \n character

Hi, I've made a script to grep a file for i in `cat filename.txt` do strings ./binfile | grep "$i" 2>&1 > /dev/null done this works fine as long as in filename.txt i don't have any entries with spaces. But in my case i want to grep something with spaces like "lala tata" and... (3 Replies)
Discussion started by: papasj
3 Replies

5. Shell Programming and Scripting

read the text file and print the content character by character..

hello all i request you to give the solution for the following problem.. I want read the text file.and print the contents character by character..like if the text file contains google means..i want to print g go goo goog googl google like this Using unix Shell scripting... without using... (1 Reply)
Discussion started by: samupnl
1 Replies

6. Shell Programming and Scripting

Replace multiple occurances of same character with a single character.

Hi all, Greetings, I have the following scenario, The contents of main file are like : Unix|||||forum|||||||||||||||is||||||the||best so||||||be|||||on||||||||||||||||||||||||||||||||||||||||||||it And i need the output in the following form: Unix=forum=is=the=best so=be=on=it ... (3 Replies)
Discussion started by: dipanchandra
3 Replies

7. Shell Programming and Scripting

Bash loop hording keypress input

I have a bash loop that waits for a single key press, then does $something depending on what $key is pressed before refreshing the screen with updated data. The problem I have is that the script will store additional key presses and chain them together causing the screen to redraw and the script... (1 Reply)
Discussion started by: DarkPhoenix
1 Replies

8. Shell Programming and Scripting

Read character by character in line in which space is also included

Hi friend, I have one file , and i want to read that file character by character. I need this script in ksh. while using read option with -n1 am getting error. while read -n1 c read has bad option And if i am using below script, then if in a line has space like this ( Pallvi mahajan)... (10 Replies)
Discussion started by: pallvi_mahajan
10 Replies

9. UNIX for Beginners Questions & Answers

Simulate keypress in bash

Hello everybody, I am using Windows 10 and cygwin/bash. I need to write a script in bash which simulates opening of a program and then press some keys such as F5, ENTER and ALT+F4. I have written a VBScript which does the job Set WshShell = WScript.CreateObject("WScript.Shell")... (9 Replies)
Discussion started by: supernono06
9 Replies

10. Shell Programming and Scripting

How to repeat a character in a field if it's a single character?

I have a csv dataset like this : C,rs18768 G,rs13785 GA,rs1065 G,rs1801279 T,rs9274407 A,rs730012 I'm thinking of use like awk, sed to covert the dataset to this format: (if it's two character, then keep the same) CC,rs18768 GG,rs13785 GA,rs1065 GG,rs1801279 TT,rs9274407... (7 Replies)
Discussion started by: nengcheng
7 Replies
Heimdal Kerberos 5 error reporting functions(3) 	      HeimdalKerberos5library		   Heimdal Kerberos 5 error reporting functions(3)

NAME
Heimdal Kerberos 5 error reporting functions - Functions KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_eai_to_heim_errno (int eai_errno, int system_error) KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_h_errno_to_heim_errno (int eai_errno) KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_clear_error_message (krb5_context context) KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_set_error_message (krb5_context context, krb5_error_code ret, const char *fmt,...) __attribute__((format(printf KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_vwarn (krb5_context context, krb5_error_code code, const char *fmt, va_list ap) __attribute__((format(printf Detailed Description Function Documentation KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_clear_error_message (krb5_context context) Clears the error message from the Kerberos 5 context. Parameters: context The Kerberos 5 context to clear KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_eai_to_heim_errno (int eai_errno, int system_error) Convert the getaddrinfo() error code to a Kerberos et error code. Parameters: eai_errno contains the error code from getaddrinfo(). system_error should have the value of errno after the failed getaddrinfo(). Returns: Kerberos error code representing the EAI errors. KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_h_errno_to_heim_errno (int eai_errno) Convert the gethostname() error code (h_error) to a Kerberos et error code. Parameters: eai_errno contains the error code from gethostname(). Returns: Kerberos error code representing the gethostname errors. KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_set_error_message (krb5_context context, krb5_error_code ret, const char * fmt, ...) Set the context full error string for a specific error code. The error that is stored should be internationalized. The if context is NULL, no error string is stored. Parameters: context Kerberos 5 context ret The error code fmt Error string for the error code ... printf(3) style parameters. KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_vwarn (krb5_context context, krb5_error_code code, const char * fmt, va_list ap) Log a warning to the log, default stderr, include the error from the last failure. Parameters: context A Kerberos 5 context. code error code of the last error fmt message to print ap arguments Version 1.5.2 11 Jan 2012 Heimdal Kerberos 5 error reporting functions(3)
All times are GMT -4. The time now is 03:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy