Skip to content

Substitute a regex pattern using awk

I am trying to write a regex expression to replace one or more ‘+’ symbols present in a file with a space. I tried the following: Expected: Any ideas why this did not work? Answer Use gsub which does global substitution: sub function replaces only 1st match, to replace all matches use gsub.

how to verify tcp checksum [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the …

Problems running MPI (OpenMPI) app on Linux on ARM

I am trying to follow this tutorial for building and running an MPI application on an ARM based Ubuntu 11.10 system. When installing open-mpi environment on my PC machine, the sample program runs well. However, trying the same on the ARM machine, the terminal hangs up and I need to kill the MPI process from a…

I need get a substring in Shell Script

i need help. I need get a substring in the next line the result must be: ttl 128 I hope you can help me! Thanks! Answer Try doing this : NOTE b is a word boundary s is a space + mean at least one or more preceding character -P switch is pcre advanced useful syntax for grep -o switch

Troubles with using memcpy with mmap

Trying to copy a file using these functions, everything goes fine until program hits the memcpy function which gives a bus error and terminates the process. Failed to figure out what is wrong, as “Bus Error” isn’t a descriptive error message and there isn’t any much material on the int…

connecting to amazon aws linux server by ssh on mac

I created a new keypair and downloaded it to my mac, then set up a new Amazon Linux AMI server with that keypair and my security group. Now I need to put the keypair .pem file that I downloaded in a .ssh file in my users folder? I am unable to create a folder called “.ssh” however because of the