I am trying to use suckless ii irc client. I can listen to a channel by tail -f out file. However is it also possible for me to input into the same console by starting an echo or cat command? If I background the process, it actually displays the output in this console but that doesn’t seem to be right
Tag: console
Call a function from the console as an argument
I have a file1.py: Now I want to call file1.battery() from the linux console with python file1.py battery. But I get the error: Answer You can use eval for compiling string like code or use globals and locals: Also, the module can import itself:
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
how to run file associated application from console linux
on windows exist command: on mac: Are there analogue command under Ubuntu? Answer xdg-open if you have a freedesktop.org-compatible environment.
Adding a status bar to c++ console applications
I am making a linux application using C++ and it will print info out to the console. Parts of the program will take a while to compute and I would like to add a status bar in the console similar to the one used in wget (I put my own depiction below). What would be the best way to accomplish
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
How to check if Linux console screensaver has blanked screen
is there a way to check programmatically (via ioctl(), etc.) or by reading a file in /sys, /proc or /dev) whether the screen has been blanked by the Linux console screensaver? Thanks and best regards, Günter Answer You can parse the output of xset q with DISPLAY set, but it’s not pretty.