I need to read first line of a file and match it with a text. If the text matches, I need to do certain operation.  Problem is if command is unable to compare the variable with the string.  file_content=$(head -1 ${file_name}) echo $file_content if [[ $file_content = 'No new data' ]]; then     echo "Should come here" fi echo $file_content if [ "${file_content}" = "No new data" ]; then   echo "Should come here" fi   The if block is not working. I think the value that I am capturing in line 1 has some issues.
Everybody knows :-) that in Windows plain text files lines are terminated with CR+LF, and in Unix&amp;Linux - with LF only. How can I quickly convert all my source code files from one format to another and back?
Unexpected behavior of rule matching a pattern If two gravitational waves came in contact with each other what would happen? In another question entirely, what happens when a higher gravitational field interacts with a weaker one. Strange character when using listings package (How) Can SE sites change their reputation payout? A recent question on  reminded me that there is a  about awarding 10 rep per question upvote. This is mainly due to the relative difficulty and usefulness of asking/answering being different on the site (or appearing to be, at least).  The highly voted answer on PPCG is "Yes, we should do that," but it's been well over three years since it was posted. The answer there said that (at least at that time) meta.so had this implemented already, so it wouldn't/shouldn't be hard to do.  Given that it's been quite some time, I don't know if that's (still) true. I know that meat has undergone changes since then, but as long as I've been actively participating, meta.se (and meta.so before the split) has given 5 points per question upvote, not 10.  My question is: What would the process to change it look like? It's been discussed on meta.ppcg and agreed upon, so what's the next step? Or is it not feasible at all? Why can I feel my seven pound cat walking across floor of my home? The house is only 9 years old. (I am the second owner)   I know they settle but in the last year I can feel all movement across the floor- year ago I could barely feel anything but did notice that when someone walked across I could feel them go by.  But more recently the cat walking across to go to the chair I can feel that.  What is going on?  I know I should not feel the cat who is 7 lbs walking by or across the floor. Split level home 9 years old Minnesota location  Is anyone out there that can explain this? explicit formula for recurrence relation $a_{n+1}=2a_n+\frac{1}{a_n}$ How to create a circular shaped grid, similar to a manhole cover I’m trying to create a circular shaped grid, similar to the one in the pic. That’s my first attempt, created by arranging several cylinders with an Array modifier and then cutting the holes via the Boolean modifier.  Now you will probably notice that it looks not elegant in any way. I’d like to have the holes perfectly arranged and in a correct order, so that there are no half holes at the border of the mesh, for example.  How would you do this?   I tried working with Dupliverts but that didn’t work out well. Number of bins when computing mutual information I want to quantify the relationship between two variables, A and B, using mutual information. The way to compute it is by binning the observations (see example Python code below). However, what factors determines what number of bins is reasonable? I need the computation to be fast so I cannot simply use a lot of bins to be on the safe side.  from sklearn.metrics import mutual_info_score  def calc_MI(x, y, bins):     c_xy = np.histogram2d(x, y, bins)[0]     mi = mutual_info_score(None, None, contingency=c_xy)     return mi How would we tell antimatter galaxies apart? Given that  galaxies are theoretically possible, how would they be distinguishable from regular matter galaxies?  That is, antimatter is equal in  and all properties, except for the opposite reverse charge of the particles, identical to regular matter. Hence a star composed of antimatter hydrogen would fuse to anti-helium in an analogous way to our own Sun, and it would emit light and radiation at the same wavelengths as any regular matter star and would cause the same gravitational forces for planetary systems to form as in any other star system.  Hence, what would be a telltale sign if you were observing a galaxy made up entirely of antimatter?  Also, is there any evidence for that half of all galaxies are not made of antimatter -- while general theories currently assume that there is an imbalance of matter over antimatter in the universe, then what is the rationale for not assuming that there is in fact an even balance between the two? How to show that $|D_{2n}| = 2n$ via the presentation? Consider the dihedral group  $$D_{2n}= \langle a,b \mid a^n = 1 = b^2, b^{-1}ab = a^{-1}\rangle$$  How can I show that $|D_{2n}| = 2n$?   I'm trying to show that we can write every element in the form  $$x = a^i b^j$$ where $i= 0, 1, \dots, n-1$; $b = 0,1$.   I managed to show existence, and it is clear that there are $2n$ such elements, so if I can show that every choice of $i,j$ gives a distinct element, I'll be done.  Any ideas? Multiple Author and email with location? I am trying to add multiple Author with their email and location but not working.  I am trying to get something like this     first_person^1 , second person^2, third_person^3            {1^mail, 2^mail, 3^mail}@gmail.com                   institution name                      location Let $G$ be a simply connected algebraic group defined over $C$.   Note : I see the definition of simply connected as "Every isogeny to $G$ is an isomorphism" as given in Hochschild's  "Basic Theory of Algebraic Groups and Lie algebras".   $C$ is an algebraically closed field.   Please help me realise the follwoing things provided they are true:   $G_C$ (the $C$-points of $G$) is simply connected as well. $Lie(G) \cong Lie(G_C)$    Thanks ! How to get my own IP address and save it to a variable in a shell script? What are good starting settings to store for exposure bracketing shots? I started experimenting with the Custom Functions (C1,C2,C3) on my Canon 7D and I decided a useful one to have may be setting it up for exposure bracketing. So it's a quick switch if I ever need it, as opposed to going through the menu to set it up.  I realize the settings would vastly depend on the situation, but do you have any suggestions for some good all round settings to program in as a starting point?    Examples: 1 stop vs 1 1/3 vs 2 stop brackets / ISO choices / Metering mode / shooting mode and so on. Is it a good idea to take a break from studying a mathematics PhD and revisit academia at a later stage? Smallest dense subset of $\mathbb{R}$ I am not sure if what I am looking for even makes sense (or) exists. Anyway I would be happy if someone can clear my confusion.  The set of real numbers $\mathbb{R}$ is obtained as completion of $\mathbb{Q}$. However, $\mathbb{Q}$ is not the only set which is dense in $\mathbb{R}$. $\mathbb{Q} \backslash \mathbb{Z}$ is also a dense subset of $\mathbb{R}$. I am wondering if it makes sense to talk of the "smallest" dense subset of $\mathbb{R}$. To phrase what I am looking for precisely and what I mean by smallest, I am looking for a dense set $A$ of $\mathbb{R}$ such that if $B$ is a proper subset of $A$ then $B$ is not dense in $\mathbb{R}$. I am able to "see" that the set $A$, I am looking for doesn't exist since any open interval consists of infinite rationals. But I am unable to precisely argue out to myself and convince why $A$ doesn't exist. Could some one throw more light on this? Lets say I have a domain already, for example www.automobile4u.com (not mine), with a website fully running and all.  The title of my "Website" says:    &lt;title&gt;Used cars - buy and sell your used cars here&lt;/title&gt;   Also, lets say I have fully SEO the website so when people searching for the term buy used cars, I end up on the second or first page.  Now, I want to end up higher, so I go to the google adwords page where you can check how many searches are made on specific terms.  Lets say the term "used cars" has 20 million searches each month.  Here comes the question, could I just go and buy that domain with the search terms adress, in this case www.usedcars.com and make a redirect to my original page, and this way when people search for "used cars", my newly bought domain name comes up redirecting people to my original website (www.automobile4u.com)?  The reason I believe this benefits me is because it seems search engines first of all check website adresses matching the search, so the query "used cars" would automatically bring www.usedcars.com to the first result right?  What are the downsides for this?  I already know about google spiders not liking redirects, but there are many methods of redirecting...  Is this a good idea generally? Is $\le$ defined by $\langle 𝑥_1, 𝑦_1 \rangle \le \langle 𝑥_2, 𝑦_2 \rangle$, if $𝑥_1 \le 𝑥_2 \land𝑦_1 \ge 𝑦_2$ a linear order? I need to tell if the relation $\le$ defined by relationship $\langle 𝑥_1, 𝑦_1 \rangle \le \langle 𝑥_2, 𝑦_2 \rangle$, if $𝑥_1 \le 𝑥_2$ $\land$ $𝑦_1 \ge 𝑦_2$ linear order?   I have already proven that the relation is an order, but I need to decide if it is a linear order and why. Thanks for any help! Input field for decimal property how to decode this JSON string?