Sponsored Content
Full Discussion: C shell program
Homework and Emergencies Homework & Coursework Questions C shell program Post 303015376 by bakunin on Tuesday 3rd of April 2018 07:54:49 PM
Old 04-03-2018
Quote:
Originally Posted by zorro_phu
2. How do i make the shell program to react when i press ctrl+T without having to press enter. For the following code which i wrote requires me to press enter to execute the command
When you read the stdin with read() as you do it you basically read linewise. You have some input field, where you can type and edit some text and you finally press <enter> to submit it - quite the same way you enter commands in the shell.

When you want to intercept single characters you need to use the getch() function or one of its variations (getch(), getchar(), getche()).

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help me with this Shell Program

Now, am in a very tight situation here. I really dont expect anyone to understand but please, try your best. am trying to right a program that goes back to the previous entry to correct a mistake. heres what am trying to do. i write a program like this Name : James Holgston... (1 Reply)
Discussion started by: TRUEST
1 Replies

2. Shell Programming and Scripting

C shell Program

Hellow every body I am trying to write a very simple script in an executable file as following if ($?PWD) then echo "OK" else echo "No" endif but I am getting error during execution in c shell as synthax error at line 4 , unexpected end of file Please advise (2 Replies)
Discussion started by: Reza Nazarian
2 Replies

3. Programming

Shell Program

I am programming the following simple shell program. It works for the most part, things like 'ls' and 'ps' work just fine. However when I add options, (example, ls -l) it does not execute the command. Also, I've been trying to add an "exit" command, so that I don't have to use the iterrupt; but... (3 Replies)
Discussion started by: TexasGuy
3 Replies

4. Shell Programming and Scripting

shell program

How to write a shell script which takes 3 strings as positional parameters,first and second are file names and third is a directory.if the two files exist in `pwd` and they contain a specific pattern and their size is greater than 32 bytes,moves these files into directory? (1 Reply)
Discussion started by: rameshparsa
1 Replies

5. Shell Programming and Scripting

shell program

hello, i have problem in awk filter in shell to concatenate two string plz send me a solution as soon as possible from jyoti ardeshana (4 Replies)
Discussion started by: jyotiardeshana
4 Replies

6. Shell Programming and Scripting

very first shell program.

in the beginners book i have it gives an exercise to try. saying to make a script that examines the time. it should keep examining every second or so and say some sort of message. Can anyone help me get going. Thanks (3 Replies)
Discussion started by: bebop1111116
3 Replies

7. Shell Programming and Scripting

help with shell program

I want to print the value of variables a1, a2, a3 in for loop in the following program: a1=this a2=is a3=printed for((i=1;i<4;i++)) do var=a$i #w=`echo $var` e=${var} echo $e done But actually I get a1,a2,a3 as the output not the "this is printed" So the main question is if I... (3 Replies)
Discussion started by: adgarg
3 Replies

8. Shell Programming and Scripting

shell program

Iam having file 1 as wc -l file1 is 8 QWEERTYUU|7927836357398398398913 yuyuyu uyiuyuyuyuy yuiyuiyuyuyy FDHGFSHAJK|1476887897877777777771 iopwiiwpoi e . . . . I Need to read the abouve line in file1 so iam using the command as tail -n 8... (8 Replies)
Discussion started by: nivas
8 Replies

9. Shell Programming and Scripting

Shell Program , need help!!

Hi all, I am trying to get a file from an ftp server and i have the list of files which needs to be get from the ftp server. grep unix_prg*.* log.txt > log1.txt log1.txt (which has the list of files) 06-29-09 00:00AM 3550258 unix_prg090629 06-28-09 07:00PM ... (7 Replies)
Discussion started by: raghav1982
7 Replies

10. Homework & Coursework Questions

Shell program in C

Hi all, I have an assignment from school to write a shell program in linux. the idea is to exercise fork() and execv() functions.. the shell program is supposed to be the master and every command that the user prints will run in a new process. we also need to try running the command in every... (1 Reply)
Discussion started by: r3vive
1 Replies
keyboard_translatekeys(3)					Svgalib User Manual					 keyboard_translatekeys(3)

NAME
keyboard_translatekeys - modify scancode mappings in raw keyboard mode SYNOPSIS
#include <vgakeyboard.h> void keyboard_translatekeys(int mask); DESCRIPTION
This function sets several flags which control how certain scancodes are mapped. At startup a mask value of 0 is active. mask must be a logical or of zero or more of the following #predefined integers to turn the features listed on: TRANSLATE_CURSORKEYS Translate the scancodes of the SCANCODE_CURSORBLOCK* keys to those of the cursor keys on the number pad, s.t. keyboard_getstate(3) and keyboard_keypressed(3) report a keypress of the corresponding number pad cursor key and not the one on the cursor block. TRANSLATE_DIAGONAL Translates the scancodes of diagonal cursor keys (keypad 7, 9, 1, 3) to presses of two of the ordinary up, down, left, right keys. For example, instead of reporting a press of SCANCODE_CURSORUPRIGHT keyboard_getstate(3) and keyboard_keypressed(3) report a simul- taneous press of SCANCODE_CURSORUP and SCANCODE_CURSORRIGHT. TRANSLATE_KEYPADENTER The scancode of the keypad enter key is mapped to that of the ordinary enter key, s.t. keyboard_getstate(3) and keyboard_key- pressed(3) report a press of SCANCODE_ENTER regardless if keypad enter or ordinary enter is pressed. DONT_CATCH_CTRLC Pressing <Ctrl>-C does not raise a SIGINT. On contrary to the other flags this has also effect when a user defined keyboard event handler is used. Svgalib will always process <Alt>-F1 - <Alt>-F10 and perform console switches accordingly. BUGS
The TRANSLATE_* options above do really do simple scancode translations. For example, when TRANSLATE_KEYPADENTER is active and the user presses both enter and keypad enter. Then, if he releases one of them (say keypad enter), it's release event will clear the common keyboard state, s.t. no keypress is reported even though enter is still pressed. Similarly, if TRANSLATE_DIAGONAL is active, the user holds cursor upleft (keypad 7) down and then presses and release cursor up (keypad 8), svgalib will only report a pressed cursor left but the simulated cursor up will be lost. You can easily try this with the keytest(6) demo to make the effect more clear to you. SEE ALSO
svgalib(7), vgagl(7), libvga.config(5), keytest(6), eventtest(6), keyboard_seteventhandler(3), keyboard_init(3), key- board_init_return_fd(3), keyboard_close(3), keyboard_update(3), keyboard_waitforupdate(3), keyboard_setdefaulteventhandler(3), key- board_getstate(3), keyboard_clearstate(3), keyboard_keypressed(3), vga_waitevent(3) AUTHOR
This manual page was edited by Michael Weller <eowmob@exp-math.uni-essen.de>. The exact source of the referenced function as well as of the original documentation is unknown. It is very likely that both are at least to some extent are due to Harm Hanemaayer <H.Hanemaayer@inter.nl.net>. Occasionally this might be wrong. I hereby asked to be excused by the original author and will happily accept any additions or corrections to this first version of the svgalib manual. Svgalib (>;= 1.2.11) 29 July 1997 keyboard_translatekeys(3)
All times are GMT -4. The time now is 05:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy