Propagate WTERMSIG exit code from child process on exit

I’m writing a wrapper command that invokes a child process, waits for it to exit, and propagates its exit code. Simple enough. I want to propagate the exit status of the child process to my own process’s exit code even if the child exited with a signal. If WIFSIGNALED(cmdret) is true for some int cmdret… Read More Propagate WTERMSIG exit code from child process on exit

sed to ignore a pattern as well as match a pattern in same line

Input file <a href="perl.html">perl</a> <a href="http://zoidberg.sourceforge.net/out.html">http://zoidberg.sourceforge.net</a&gt; <a href="zoiduser.html">zoiduser</a> <a href="perl.html">perl</a> <a href="http://zoidberg.sourceforge.net/sample.html">http://zoidberg.sourceforge.net</a&gt; I need to only remove .HTML extension from below URL from above file: <a href="perl.html">perl</a> <a href="zoiduser.html">zoiduser</a> So that the final output should look like: <a href="perl">perl</a> <a href="http://zoidberg.sourceforge.net/out.html">http://zoidberg.sourceforge.net</a&gt; <a href="zoiduser">zoiduser</a> <a href="perl.html">perl</a> <a href="http://zoidberg.sourceforge.net/sample.html">http://zoidberg.sourceforge.net</a&gt; This is what I am doing: sed ‘/"http\|"www\|"mailto/… Read More sed to ignore a pattern as well as match a pattern in same line

sed replace * in url with text in json file

I’m looking to change the value of a key in a json file Example: "House":"sample.house.city" Need to change the word "sample" to something else. I can do this with: sed -i ‘s|sample.house.city|town-home.house.city|g’ file.json but there is no guarantee that "sample" is going to be the same every time. I’ve tried: sed -i ‘s|*.house.city|town-home.house.city|g’ file.json but… Read More sed replace * in url with text in json file

Running into "error: […] is a c++ extension"

After running: g++ –std=c++11 -ansi -pedantic-errors -Wall -o test_database test_database.cpp I am receiving the following errors: ./database.h:40:10: error: ‘auto’ type specifier is a C++11 extension [-Werror,-Wc++11-extensions] for (auto x:composerMap_) { ^ ./database.h:40:16: error: range-based for loop is a C++11 extension [-Werror,-Wc++11-extensions] for (auto x:composerMap_) { Yet note that I have already added the ‘–std=c++11’ flag… Read More Running into "error: […] is a c++ extension"