Skip to content
Advertisement

Tag: console

Signal and output in c

Some time ago I found this exercise in C: without changing the main function, so that receiving a SIGUSR1 signal output is directed and added to a file in append mode as the first parameter. At the reception of another SIGUSR1 the output is directed to the console, and so on. How do such an exercise? Answer I’ll give you

Delete last executed command in Linux terminal

I want to do a clear but only of the last command I executed. Here is a example so you can understand it better: If that’s the current state of the shell I want to execute a command (for example echo a > /tmp/foo) and keep the console: So it should be something like echo a > /tmp/foo && clear

Run a perl script with the ending .pl

I have a question to perl scripts. I can write and understand C and C++ codes but have no experience in perl. I have a perl script with the extension .pl and want to run it on a Raspberry Pi Model B. I get the script (its a part of the Raspberry Pi B extension ‘Busware SD0’ Firmware) from this

C — using chdir() function

I’m trying to use chdir() function but can’t work it out. I’m reading from user and find out if he is using “cd”. I always get an error. What am I doing wrong? Code: Answer If the line being entered is something like: then the directory starts at offset 3, not 2. In addition, fgets usually gives you a line

clear scrollback buffer of Linux Virtual Console Terminals

I’d like to clear the scrollback buffer on Linux console VTs programmatically. i.e. not just clear the current visible screen, but the entire scrollback buffer, too. I.e. everything that after a clear screen would still be visible with Alt-PgUp should be gone too. Anybody got an idea how to achieve that in nice code? Answer I don’t think this is

Advertisement