So in insert mode if you hit ctrl-x s on a misspelled word you get a nicely formatted popup menu of spelling suggestions. This is awesome. The comparable command in normal mode (z=), however, gives a bland plain-text list that eats the whole screen. I’ve partially solved this by adding the following key…
Linux kernel : logging to a specific file
I am trying to edit the linux kernel. I want some information to be written out to a file as a part of the debugging process. I have read about the printk function. But i would like to add text to a particular file (file other from the default files that keep debug logs). To cut it short: I would
Why does (ps -f) create no subshell but a separate process?
I need some help because I don’t get something. From what I read from Internet, a subshell is created when we execute a shell script or if we run command in brackets: ( ) I tried to test this with a script which contains only the following command: When I run it I see the following result: Which is good…
How to send signal to program run in a docker container?
I have a program run in a docker container with detached mode. So how to send a signal such as SIGINT to this program? Answer You can use nsenter to get into your container space and send your signal. More info : http://jpetazzo.github.io/2014/06/23/docker-ssh-considered-evil/
awk sum every 4th number – field
So my input file is: I want to sum the numbers then write it to a file (so i need every 4th field). I tried many sum examples on the net but i didnt found answer for my problem. My ouput file should looks: Thanks! Update: The problem is the same. I want to sum the 3th numbers (But in
Why does QCoreApplication call `setlocale(LC_ALL, “”)` by default on Unix/Linux?
I think that it’s safe to say that C locales are universally recognized as a bad idea. Writing an application that tries to parse or write text-based machine formats (which happens quite often) with C standard library functions gets near-impossible if you have to account for locale being set to anything…
How to select the nth char from a string for each line in a file?
Every line has a word and a number. I need somehow to select the nth letter which all together will make a new word. For example: it has to start like this and I’m only allowed to use sed (no awk, perl, …). I know how to select all the numbers or the text and I was thinking about but
popen (“tar xvf tarball.tar”) works in debug but not release builds
I’m working on a C++ program for Ubuntu that downloads a tar archive using curl_easy_perform, and after the archive is downloaded into /tmp I use popen to execute the appropriate tar command line. When I run my program’s debug build then popen(“tar xvf /tmp/example.tar -C /tmp/existingdir…
Use terminal to display image without losing focus
I have a bash-script in which I want to display an image to the user. This is possible using ImageMagick’s display. But now the focus of the terminal window is lost, and is placed to the image. To continue my bash-script I have to ask the user to click on the terminal before continuing. This is unwanted…
trouble with opening file for read with fopen
I am new to writing c under linux so this will be maybe silly question, but I have problem using fopen. When I encountered the problem I just tried it with this really simple code: test.txt is in same folder as this code and a.out. When I debug a.out I get: I tried changing the path: if( fopen(“/home/h1…