linux

How can I get the "full" makefile if a Makefile contains "include"?

Is it possible to get the "full" makefile if makefile contains "include"? For example: #here is the contents of Makefile include inc1.i include inc2.i clean: rm -rf * #here is the contents of inc1.i abc: touch abc #here is the contents of inc2.i def: touch def How can I get a "full" Makefil...

gprof error: profile file has unsupported version

I am trying to profile a shared library but there is an error when I invoke gprof: $ export LD_PROFILE=libMy.so $ ./a.out $ gprof -q libMy.so /var/tmp/libMy.so.profile gprof: file /var/tmp/libMy.so.profile has unsupported version 131071 Shared library was compiled with -ggdb -pg flags. gcc version 4.2.1, gprof versio...

Good collection of libraries for C?

I'm looking for a good collection of libraries for ANSI-C, stuff for handling vectors, hash maps, binary tress, string processing, etc. ...

Linux special file

I am trying to create the file mysql.sock as with the following permissions srwxrwxrwx 1 mysql mysql 0 2009-10-07 09:55 mysqld.sock I know this is done with mknod, but I am not sure of the parameters. I don't want the C programming documentation, just a command for the bash shell ...

How do I import environment settings into my Perl program?

I have a script whose content simply exports a variable in linux. export LD_LIBRARY_PATH=.... I want to run this script in my Perl script so whoever is running my Perl script will have their LD_LIBRARY_PATH set. Can i just do this in the beginning of my Perl script: #!/usr/bin/perl -w system(". /myfolder1/myfolder2/myScript.sh"); ...

Linux text editor for working with huge files

Hello, I have a huge (~2GB) file that I need to navigate around. I don't actually need to edit it, just jump around efficiently. I tried vim but it choked. Any recommendations for working with huge files on Linux? Thanks ...

Running a command in shell script

Hello I have a shell script file (run.sh) that contains the following: #!/bin/bash %JAVA_HOME%/bin/java -jar umar.jar when i try to run it (./run.sh), it gives me following: umar/bin/run.sh: line 1: fg: no job control However if I run same command directly on shell, it works perfectly. What's wrong with the script file? Thanks ...

Running a jar from shell script

Hello friends I have a jar file named umar.jar in /root/umar/bin directory. I have a shell script file run.sh in same directory. Following is the content of run.sh #!/bin/bash "$JAVA_HOME"/bin/java -jar /root/umar/bin/umar.jar Now when I run the shell script, I get the following error Exception in thread "main" java.lang.Unsupported...

Good real-time programming books for beginner's questions

I find myself in a situation where I need to work on a embedded, real-time system at work without much prior knowledge. I've done a fair amount of research online, but found nothing satisfactory, so I'm now turning my attention to books. I've seen this StackOverflow page but I'm not sure if the books that it points to are what I'm looki...

Operator new and bad_alloc on linux

On Linux, malloc doesn't necessarily return a null pointer if you're out of memory. You might get back a pointer and then have the OOM killer start eating processes if you're really out of memory. Is the same true for c++'s operator new or will you get the bad_alloc exception? ...

How to use sed to delete a string with wildcards

File1: <a>hello</b> <c>foo</d> <a>world</b> <c>bar</d> Is an example of the file this would work on. How can one remove all strings which have a <c>*</d> using sed? ...

Use sed to delete all leading/following blank spaces in a text file

File1: hello world How would one delete the leading/trailing blank spaces within this file using sed - using one command (no intermediate files)? I've currently got: sed -e 's/^[ \t]*//' a > b For leading spaces. sed 's/ *$//' b > c And this for trailing spaces. ...

pgpgin and pgpgout - Linux Counters in /proc/vmstat

Hi, I am writing an application which collects overall system I/O statistics. I was wondering whether the two counters for page-ins and page-outs, pgpgin pgpgout in /proc/vmstat include pages written to, and read from all disk-based block devices attached to the system. Please let me know, if you can! ...

Is Mono really cross-platform?

Official Mono project website says that Mono works successfully on Windows, Linux and Mac OS X. Is that true? I want to build applications which work at least on Windows and Linux. Is it possible with Mono? P.S. I know that similar topics already exist (e.g. http://stackoverflow.com/questions/56013/cross-platform-net), but they may be...

Remove strings after each first word in a text file

File1: hello (OPTION1) 123456 123456 123456 world (OPTION1) 123456 123456 123456 foo (OPTION1) 123456 123456 123456 bar (OPTION1) 123456 123456 123456 How would one remove each string after each first word in the textfile File1? This would probably be down with awk/sed/cat - but I cannot figure it...

busybox sh wrapper to add extra functionality

I need a simple busybox sh wrapper which will do: IF "-Q" PARAMETER IS PROVIDED THEN acommand ALL PARAMETERS BUT "-Q" 2>&1 1>/dev/null ELSE acommand ALL PARAMETERS FI Parameters may include spaces. BTW I want to run the script with busybox sh and it doesn't support arrays. ...

Qt Linking Error.

...

Which language to use for implementing few Linux shell commands (homework) - plain C or C++?

I need to implement a few commands of Linux shell for my homework - 5 or 6 of them, including ls. Do not know much about which parameters to implement for each of commands... I planned to use C++, but when I asked my colleague for advice what language to choose - plain C or C++, he said that interpreter was not a program in traditional ...

Malloc/free algorithm in Suse

Which implementation of malloc/free is used in a specific Linux distribution (in my case Suse 9 and Suse 10) ? Has it change between both versions ? Is it the same algorithm for 32 bits and 64 bits versions ? ...

How do I use waf to build a shared library?

I want to build a shared library using waf as it looks much easier and less cluttered than GNU autotools. I actually have several questions so far related to the wscript I've started to write: VERSION='0.0.1' APPNAME='libmylib' srcdir = '.' blddir = 'build' def set_options(opt): opt.tool_options('compiler_cc') pass def configure(c...