how command is repeated in terminals in bash shell
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
how command is repeated in terminals in bash shell
I am on the process of making a shell . It has some functionalities and a little bit of signal handling. Now I want to know how in bash shell commands are repeated using an arrow key(u can see the previous command when u press the up arrow).Can anyone give me some idea?
Well I thought my post needed a revision. Consider the following code fragment:
#include <stdio.h>
#include <stdlib.h>
int main(){
char c = getchar();
printf("%c\t%d\n",c,c);
return 0;
}
Whenever I run this program the character I press a key to get a character. that character is echoed on terminal.Then again the char and its ascii value is printed.All I want is that the character is not echoed on the screen when I press it.For example with char 'a' I get printed:
a
a 97
but I want 'a 97' only.Is there a way of doing that?
Another thing,consider the same program with input of 'up arrow key'(not the string,for sure).It prints on terminal :
^[[A
> 27
=
'>
='(character is not entirely like that,but copying from terminal doesnot put the correct character)
Does some keys in the keyboard are handled some other way?
hello Wim Sturkenboom. I've been thinking this for a while but does this mean that bash always receive encoded characters and no more raw input? I mean no more scan codes or the likes?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.