Replacing a string with a real number using a variable I can replace a string by a string using sed, but how can I replace a string with a number? My code is:  while read x  do echo $x  sed 's/xx/$x/g' xy.in &gt; x1 cat &gt; x1 &gt;&gt; x2.dat done &lt; xyz.dat   I want to replace string xx in xy.in with the number that I read from file xyz.dat. But Instead of the number, I am getting blank spaces in x2.dat.
How do I use variables in a sed command? I tried the following code to replace QQ with ZZ, but it doesn't do what I want:  var1=QQ sed -i 's/$var1/ZZ/g' $file   However, this code does what I want:  sed -i 's/QQ/ZZ/g' $file   How do I use variables in sed?
Replicate data from one list to another list sharepoint How should a question which quotes a question be punctuated? Suppose there is a sentence in question form, like the one appearing below:     Where do you belong to?   Now, if a speaker refers to that question, he will frame another sentence and will place the question in the quotation marks in that sentence, like what is appearing below:     They said, "Where do you belong to?"   Now, if the speaker wants to convert this sentence too in question form, he will put the original question in another question, like what is appearing below:     What did they mean by saying "Where do you belong to?"   Now, if the speaker wants to rephrase this sentence, it would become as follows:     By saying "Where do you belong to?" what did they mean?    My question is how the 4th sentence is to be punctuated. It has two question marks in it. Does the sentence correctly take two question marks? If so, why will the 3rd sentence not take two question marks − one, just before the closing inverted commas and, the second, just after those commas? The 4th sentence and the 3rd sentence are all same, except being a bit different in placement of the words. Will they take two different sets of punctuation marks? Embedding a link (or other html) in a JSF message Is there a possibility to change the font-style in the table of contents? Everything I wrote down in my document was written with Times. However, the ToC does not have the same font family. Is there a way to change the font of the ToC to Times New Roman? Thank you : )    \documentclass[a4paper, fontsize=11pt]{scrbook} \usepackage{geometry} \geometry{a4paper, top=25mm, left=25mm, right=25mm, bottom=20mm, headsep=10mm, footskip=12mm}  \usepackage[ngerman]{babel}  \usepackage[T1]{fontenc}        \usepackage[latin1]{inputenc} \usepackage{acronym}      \usepackage{anyfontsize}  \begin{document}  \tableofcontents  \chapter{Test} Is there a possibility to change the font-style in the table of contents? Everthing I wrote down in my document was written with Times. However, the ToC does not have the same font family. Is there a way to change the font of the ToC to Times New Roman?  \end{document} At  I've read that being $\sin(x)=\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)!}x^{2n+1}$ by using  we get $\sin'(x)=\sum_{n=0}^{\infty}(2n+1) \frac{(-1)^n}{(2n+1)!}x^{2n}=\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}x^{2n}=\cos(x)$ but the page  says that if $f(x)=\sum_{n=0}^{\infty}c_n(x-a)^n$ then inside the radius of convergence of the power series we have $f'(x)=\sum_{n=1}^{\infty}nc_n(x-a)^{n-1}$ so shouldn't it be $\sin'(x)=\sum_{n=1}^{\infty}(2n+1)\frac{(-1)^n}{(2n+1)!}x^{2n+1-1}=\sum_{n=1}^{\infty}\frac{(-1)^n}{(2n)!}x^{2n}$?  Now I understand that this last result has a missing term due to the index of the series being $1$ and not $0$ but being the $1$ mandatory because of the above theorem and since trying to shift index doesn't help (we get $\sin'(x)=\sum_{n=0}^{\infty}\frac{(-1)^{n+1}}{(2n+2)!}x^{2n+2}$) how can the result that ProofWiki shows be rigorously justified?   (I mean, I think we can't just say "oh, there's a missing term!" after having applied the theorem and magically shift the index of the series to obtain the desired result) How many physical degrees of freedom does the $\mathrm{SU(N)}$ Yang-Mills theory have? The $\mathrm{U(1)}$ QED case has two physical degrees of freedom, which is easy to understand because the free electromagnetic field must be transverse to the direction of propagation. But what are the physical degrees of freedom the $\mathrm{SU(N)}$ Yang-Mills theory?   I believe that the $\mathrm{SU(N)}$ Y.M. theory has four degrees of freedom, and it is easy to see that by gauge fixing (such as the Lorentz condition or the Coulomb condition) that we can always remove one redundant degree of freedom. But then we still haven't completely fixed the redundant degrees of freedom. Thus my question is:     How many physical degrees and how many are redundant degrees of freedom does the Y.M. theory have?    I would be interested to understand how we can determine this mathematically, and also to understand what the physical intuition behind this is? Facebook message notification showing blank message Since I updated the system to 10.11.5, the Facebook message notification is not showing message text.   Is this a bug in this software upgrade of OSX? The following question is from Artin's Algebra.      If $A$ and $B$ are two square matrices with real entries, show that $AB-BA=I$ has no solutions.    I have no idea on how to tackle this question. I tried block multiplication, but it didn't appear to work. need initfamfs modules. 15.04 is anything else supposed to be here? I am using Ubuntu gnome and my keyboard is unresponsive for encryption password. Do I need any more modules, and if so where do I add them.  # List of modules that you want to include in your initramfs. # They will be loaded at boot time in the order below. # # Syntax:  module_name [args ...] # # You must run update-initramfs(8) to effect this change. # # Examples: # # raid1 # sd_mod The PHB is a bit unclear when it comes to readied spells in combat. If I lose my concentration do I lose the spell slot? What about if the trigger never occurs, do I get the spell slot back? ST_Length (GEOM, true) for calculating distances in Geographic Reference System I know this is a very common corollary of the class equation. And I know how to do it by using class equation.   But can you do it bu using group action, maybe find a nice set for G to act on? How did Princess Leia survive this? In the Last Jedi movie, there is a scene where      her spaceship is taken down, Princess Leia is thrown into outer space, and seen floating there, frozen.    However, she manages to survive this, while any ordinary human being couldn't.   How did she manage this? Is this done by using the Force? Book about classical mechanics Showing inequality for harmonic series. I want to show that $$\log N&lt;\sum_{n=1}^{N}\frac{1}{n}&lt;1+\log N.$$ But I don't know how to show this. Given a file L with one non-negative integer per line and text file F, what would be a fast way to keep only those lines in F, whose line number appears in file L?  Example:  $ cat L.txt 1 3  $ cat F.txt Hello World Hallo Welt Hola mundo  $ command-in-question -x L.txt F.txt Hello World Hola mundo   I'm looking for a command that can handle a file L with 500 million or more entries; file L is sorted numerically.  Note: I'm halfway through an implementation for a command-in-question but I just wondered, whether one might be able to use some Unix tools here as well.    Update: Thank for all the answers, I learned a lot today! I would like to accept more one answer, but that's not possible. Select node without namespace with XPath How to restrict some websites in Ubuntu 14.04 For example, is it possible to drink a flying potion and cast greater invisibility spell on myself (both spells would require concentration), so I can fly around invisible? Why are my render times 30+ minutes, but other people's are ~3 minutes? I am currently using Sheep It! to render my blend (built on v2.68c) on multiple computers, and I noticed something rather strange. According to the log on-site, the frames rendered from other people's blends were completing in 3 to 4 minutes. This was on an 4 core i5. My main rig (with an 8 core i7) was completing frames in no less than half an hour. How is this possible?  To clarify, these people's frames are very complex, often with very detailed textures. I have 2 objects in my blend. Below are the options I changed for my blend:   Aspect Ratio: 1000px x 1000px Output: PNG Clamp Indirect: 0.98 Render Sampling: 128 Min Light Bounces: 0 Max Light Bounces: 4 Cycles Render   Is there something in there that I should change to make it go faster? I can't really comprehend how it's going to quickly.  EDIT: To answer what @Duarte asked...   System Specs: i7-920, 3GB DDR3, GT 630, Windows 10 I have two circles, extended to form a sort of coin with a star on it. It is not complex at all. I have Firefox and Steam running in the background, but not actively. I've been away from the computer for 8 hours and noticed this behavior. (I am running Blender from Steam.) I made sure when I began rendering that the blend was set for CPU rendering.          And to answer what @pycoder asked, yes, I am using Cycles Render.