I’m developing a large optimzation tool using Qt. For a better CPU usage I use QThreads. Then I move worker objects (derived from QObject, containing non QObject data members) into the threads. Everything looks fine, builds fine and runs smoothly on Linux using GCC and Qt 4.8 However using MinGw using Q…
Print error for missing argument
I am trying to write a script which will check number of arguments for first and second number; if both variable entered, it will do the calculation; if one argument is missing, it will print error message. Here what I’ve done so far: I am always getting error message even though I enter both of the num…
Printing all the lines that contain a certain word exactly k times
I have to search for all the lines from a file which contain a given word exactly k times. I think that I should use grep/sed/awk but I don’t know how. My idea was to check every line by line using sed and grep like this: My first problem is that I get the following error : syntax error near
Why can’t I upload folders to a Linux EC2 Instance?
I have been uploading my files and folders to my Linux EC2 Instance using SSH for the past month. Yesterday I updated the Linux version, and since then I cannot upload folders to the Instance, but I can still upload files. Why is this happening and how can I fix it? Here’s what I’m using to upload…
Comm command – unnecessary restriction?
This is a question about the comm command on linux command line. Why does it work on only sorted files? Why can’t it sort the files for us, then do its thing? To illustrate: If we have file1 and file2, and we wish to compare them using comm, we find that we obtain an unexpected result if either of the
searching a file in linux
I want to find in the system a file, and I know part name of it. How could I do that? I tried unsuccessfully the command: The problem is probably very easy however I cannot find a decent tutorial on searching files in linux. Please tell me what command solves my problem and if you know a good tutorial so
Library installation with yocto recipe
have a bit of a problem creating a recipe for yocto. More specifically i have to install a library from git that normally installs like this: My question is how can I add this to the recipe functions do_configure, do_compile, do_install. Haven’t found much information or examples online. Update 1: This …
How to predict a size of a process’ core file before generating it with GDB?
How can the size of the core file be predicted based on for example /proc/pid/maps, /proc/pid/coredump_filter, values shown by top like VIRT RES and so on? Generally speaking, on what does the size of the core file depend and what exactly does the file contain (which parts of virtual address space?)? I’…
Running Perl script accidentally locked a folder
I have a Perl script which has the following code Upon running this script, I am unable to access the current folder (and open this script of course) anymore. When seeing the folder in Konqueror, there is an additional lock in the folder icon. Can anyone tell me what happened and how can I undo this? I have c…
Having some issues with Perl Splitting and Merging Functions
First and foremost, I’m not familiar with Perl at all. I’ve been studying C++ primarily for the last 1/2 year. I’m in a class now that that is teaching Linux commands, and we have short little topics on languages used in Linux, including Perl, which is totally throwing me for a loop (no pun …