sed replacing text in a file I would like to replace &lt;Path_To_BOOST_LIB_DIR&gt; in a file with the content of ${PREFIX}/lib but this command   sed -i .bak 's|&lt;Path_To_BOOST_LIB_DIR&gt;|echo ${PREFIX}/lib|' src/CMakeLists.txt  produced  set(BOOST_LIB_DIR echo ${PREFIX}/lib)  What did I do wrong?
How can I use variables in the LHS and RHS of a sed substitution? I want to do:  cat update_via_sed.sh | sed 's/old_name/new_name/' &gt; new_update_via_sed.sh   in my program.  But I want to use variables, e.g.  old_run='old_name_952' new_run='old_name_953'   I have tried using them but the substitution doesn't happen (no error). I have tried:  cat update_via_sed.sh | sed 's/old_run/new_run/' cat update_via_sed.sh | sed 's/$old_run/$new_run/' cat update_via_sed.sh | sed 's/${old_run}/${new_run}/'
Print two files in two columns I want to print two files in two columns -- first file on the left side and second on the right side. paste doesn't do the job, because it can only insert a character as delimiter, so if first file lines have different length output will be twisted: $ cat file1 looooooooong line line $ cat file2 hello world $ paste file1 file2 looooooooong line   hello line    world  If it was a command to add trailing spaces like fmt --add-spaces --width 50 the problem would be solved: $ paste &lt;(fmt --add-spaces --width 50 file1) file2 looooooooong line                                 hello line                                              world  But I don't know a simple way to do this. So how to merge and print several files horizontally without twisting? Actually, I just want to look at them simultaneously.  UPD: command to add trailing spaces does exist (for example, xargs -d '\n' printf '%-50s\n') But solution like $ paste &lt;(add-trailing-spaces file1) file2  does not work as expected when file1 has fewer lines than file2. When should com­pound words be writ­ten as one word, with hy­phens, or with spaces? Booking travel tickets for visa without paying? OS X computer name not matching what shows on terminal My computer name in System Preferences &gt; Sharing is set to &quot;archos&quot;, but is showing as &quot;iphone&quot; on Terminal. It just started doing this after I loaded Xcode for doing iPhone development: Last login: Mon Nov  7 14:46:55 on ttys001 iphone:~ travis$   Any ideas what could be causing this? Finding functions such that $f(g(x)) = f(x)g(x)$ Let's assume the functions in question are continuously differentiable. If $f(g(x)) = f(x)g(x)$, then: $$f'(g(x))g'(x) = f'(x)g(x)+f(x)g'(x)$$ I attempted to find a particular solution by letting $g(x) = x$. Then, $$f'(x) = xf'(x) + f(x)$$ $$df = xdf + fdx$$ $$\frac{df}{f} = \frac{dx}{1-x}$$ $$\ln(f(x)) = -\ln(1-x)+C$$ $$f(x) = \frac {A}{1-x}$$ Where $A$ is a constant. This solution was fairly unsatisfying to me, and upon checking it, I see it doesn't actually work, as letting $g(x) = x$ leads to $f(x) = xf(x)$. I was wondering if there were better answers, or at least a less trivial way to go about the problem. Animated textures don't work in Blender viewport playback How do I create a reflective white material? I'm pretty new to this and this is my first question here, any help would be greatly appreciated.  So basically what I want to achieve is a floor material as seen in this photo...    ...the reflections are very crisp but dim.  With a glossy shader I get the following results:    First picture: reflections are blurry  Second picture: roughness of the material looks right but reflection is bright red  Third picture: If tinted in any other color than white, it seems to produce the result I want. Reflection is sharp and gets tinted blue. What I need is the reflection to be tinted white.  Thanks for any help. I often see questions edited into this form:     Lorem ipsum dolor sit amet blah blah blah paragraph paragraph original question.            UPDATE: The Lorem disappeared and left this message: "new information".   I find this format unaesthetic (since Stack Exchange posts are supposed to be useful in the long term and update boundaries are artifacts of the creation rather than the content) and feel that new information should, whenever possible, be incorporated into the original text “as if it had always been that way” if practical, and pointing out an update should be done mostly in comments.  Is this an appropriate writing style, and if so under what circumstances? If not, should it be removed or discouraged? Touch enabled monitors and Android I seem to have clicked on something that changed my display preferences. The main site is now very minimalistic, with fewer controls and different fonts.  I want to change it back, but where is it? Proof of when is $A=X^TX$ invertible? Say we have an $n\times m$ matrix $X$. What are the specific properties that $X$ must have so that $A=X^TX$ invertible?  I know that when the rows and columns are independent, then matrix $A$ (which is square) would be invertible and would have a non-zero determinant. However, what confuses me is, what sort of conditions must we have on each row of $X$ such that $A$ would be invertible.   It would be very nice to have a solution of the form:   when $n &gt; m$ then $X$ must have... when $n &lt; m$ then $X$ must have... when $n = m$ then $X$ must have...   I think in the 3rd case we just need $X$ to be invertible but I was unsure of the other two cases. Commutator of two normal subgroups with trivial intersections So I tried looking everywhere but I'm really lost with this proof. I need to to show that:  Let $H$, $K$ be normal subgroups of a group $G$, satisfying $H\cap K = \{e\}$. Let $h\in H$, $k \in K$. (a) Prove that the commutator $w = hkh^{-1}k^{−1}$ satisfies $w \in H$ and $w \in K$. Then conclude that $w = e$ (b) Prove that $hk = kh$, for all $h \in H$, $k \in K$. how do you make commands not show up on the chat I am making a server, and I put a comparitor clock down to constantly have clear weather. How do I silence the commands? How does comment voting and flagging work? Comments can now be upvoted and flagged. How do those features work? Do users get rep for their upvoted comments? Do upvoted comments have any effect on comment sorting? And can users see their own comment upvote number somewhere?  Related:  The  about comments Is there a way to consistently increase the vertical spacing between equation lines in a gather (or gather*) environment from amsmath?  Specifically, I want to produce something like  \begin{gather*} a = b \\[2ex] c = d \\[2ex] e = f \end{gather*}   without having to write [2ex] at the end of each equation line.  I can think of some hacks that redefine \\ to automatically add the spacing, but is there some cleaner/better way to achieve this? How to access a variable from another script in Unity c# When do you use Java's @Override annotation and why? What are the best practices for using Java's @Override annotation and why?     It seems like it would be overkill to mark every single overridden method with the @Override annotation.   Are there certain programming situations that call for using the @Override and others that should never use the @Override? Percentage of overlapping regions of two normal distributions I was wondering, given two normal distributions with $\sigma_1,\ \mu_1$ and $\sigma_2, \ \mu_2$   how can I calculate the percentage of overlapping regions of two distributions? I suppose this problem has a specific name, are you aware of any particular name describing this problem?  Are you aware of any implementation of this (e.g., Java code)? Why didn't Dumbledore just hunt Voldemort down? How do I unit test (using xUnit) a class that has internal private methods, fields or nested classes? Or a function that is made private by having  (static in C/C++) or is in a private () namespace?  It seems bad to change the access modifier for a method or function just to be able to run a test.