I developed in on 64-bit MAC. And I wish it would work under two scenarios: 64 bit server and 64 bit client 32 bit server and 64 bit client ONLY DEALING *NIX NOW Between the communication of server A and client B, I would exchange a linked list of struct, which is of the following type: both size of char
Tag: linux
What counts as a symbol while mangling C++ names on Linux?
On Linux g++/clang++ is mangled as _Z10test10058lPFPvS_EPFS_PKvEPFS3_S_E According to g++/clang++, how many symbols are there in this function definition ? What are the substitutions ? (S_, S0_, S1_, …) More specifically what is S3_ ? (edit – adding some context) The D language allows to interact …
execute code only while sys.argv[1] exist
I have this code: and i want execute this piece of code only while sys.argv[1] is exist: if i only start the program without an arguments (python program.py) it’s print this text: I tried “if sys.argv == 1” but doesnt worked. Any solutions? Thanks Answer Now your program will terminate entir…
Python command line arguments linux
I have this little program(I know there is a lot of errors): If i start it by typing python file.py testfile.txt the output will be always(even if the file doesn’t exist): If you don’t know what iam want from this program, i want to print “File ‘filename’ wasn’t found”…
Linux bash script removing part of string line by line
After greping output of command i have get below result: PAPU 0 1000 GPRS ATTACH SUCC GB 2400 2382 2333 (10) 1244 GPRS ATTACH FAIL GB 1216 1219 1252 (10) 16000 GPRS ATTACH SUCC IU 986 986 1027 (10) 16001 GPRS ATTACH FAIL IU 170 185 171 (10) 2000 PDP-C ACTIVATION SUCC GB 5356 5138 5030 (10) 2109 PDP-C ACTIVATI…
How to abort if command fails in Unix shell?
I’m not very great with shell scripting and still couldn’t find a solution to this. I want to run a command gulp tslint and if it returns errors, abort the script. So far I tried gulp tslint || exit 1 with no success. I think it somehow is returning true, even though it has errors when i run it on
how to grep lines according to 6th field contents
I would like to know how to filter lines according to the mem usage: I would like to be able to find only the PIDs that (RES mem usage) exceed 5GB Explicitly, I have the following lines and I’d like to grep only the lines where the 6th field is larger than 5 GB EDIT: Note that sorting is not
C: Trying to implement unnamed pipes
I’m trying to make a program that simlutates the terminal’s nameless pipes. For example, if I want to run the command: ls –l | grep ‘10’ would be: ./pipes ls -l – grep ’10’ (I use – instead of |). However, my program doesn’t work because execvp fails (bad adress). Thi…
Removing trailing bin/java at end of environmental variable in linux
I am trying to compile mahout, I have temporarily changed the JAVA_HOME variable like this: and I checked that it was changed correctly using this command: which returns: But when I run mahout mvn clean install -DskipTests=true I run into this error: Error: JAVA_HOME is not defined correctly. We cannot execut…
How to write to data register in C, without touching previous writes?
Iam a beginner in C and have this scenario: I can successfully write to a gpio port with data register 0x103 and direction register 0x95. If I want to write to another pin I have to “overwrite” the previously pin. As if I first write 00010000 and then want to make another pin high I need to write …