I would like to run a shell script from my ruby file. Then capture its output and analyze it.  This is the scenario: - Within my ruby script I need to execute the my_script.sh  - The shell script produce the followinf output in the terminal  &gt; my_script.sh   xxxxx 1111   yyyyy 2222   zzzzz 3333    I need to capture and analyse this ouput inside the ruby script in order to find if a keyword is displayed (e.g., yyyy).   I'm using the following comand:  my_script = "/home/script.sh" system("sh #{my_script}")   I'm not able to capture the output produced in the terminal for parsing
If I call a command using  in Ruby, how do I get its output?  system("ls")
How secure is Activation Lock on iOS 7 (and later)? Proving this relation is transitive Let $r$ be a relation on $A \times A$ such that $(a,b) r (c,d) \iff ad = bc.$ How can I show that this relation is transitive, ie. $(a, b)r(c,d)$ and $(c,d)r(e, f) \implies (a,b)r(e,f)$?  I tried to say that $(a,b) r (c,d)$ means that $c=ka$ and $d=kb,$ $k$ a coefficient, such that $ad = bc \iff akb = bka,$ and going on from there, but I'm not sure this is valid for all values of $a, b, c,$ and $d$. How can I show the transitivity of the relation? Need linebreaks in some columns of a wide table I am trying to create linebreaks in some of the cells of my table, since I have long sentences and the table doesn't fit on an A4 page. How to let LaTeX choose the linebreaks?  Here is my code   \begin{table}[hbt] \centering \begin{tabular}{lllllll}     \toprule     &amp;  Raumgewicht $\gamma$'$_m$ and [$\frac{kN}{m^3}$] &amp;Reibungswinkel $\phi$'$_m$[]&amp; Kohäsion c'[] &amp; M$_E$-Wert []&amp; N$_SPT$ [] &amp; k-Wert []  \\     \midrule     Auffüllungen/Deckschicht&amp; 18&amp; 27 &amp; 0 &amp; 10* &amp; 17 &amp; -\\     Rückstausedimente nicht vorbelastes&amp; 21 &amp; 28 &amp; 10 &amp; 10 &amp; 15 &amp; $5\times10^-8$ - $1\times10^-6$ \\     Rückstausedimente vorbelastet &amp; 22 &amp; 32 &amp; 10 &amp; &gt;50 &amp; 91 &amp; $5\times10^-8$ - $1\times10^-6$ \\     Moräne &amp; 22 &amp; 36 &amp; 5 &amp; &gt;50 &amp; &gt;100 &amp; $1\times10^-8$ - $5\times10^-6$\\     \bottomrule \end{tabular} \caption{Bodenkennwerte} \label{tab:Bodenkennwerte} \end{table}   My preamble is  \documentclass[12pt,a4paper]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage{booktabs} \usepackage{stackengine} \usepackage[top=3cm, bottom=2.5cm, left=2.5cm, right=2.5cm, footskip = 1cm]{geometry} \usepackage{hyperref} How long does Alchemist's Fire burn? Looked and looked, can't find the answer anywhere (maybe I'm blind):  How long does Alchemist's Fire burn for?  In the item description within , it says:     On a hit, the target takes 1d4 fire damage at the start of each of its turns. A creature can end this damage by using its action to make a DC 10 Dexterity check to extinguish the flames.   Yet no mention of the burn rate.  One round after a hit?  2?  A minute?  Continuous until extinguished? Let $f_n, f \colon [a,b] \to \mathbb{R}.$ Show that, if $f_n \to f$ uniformly, then the Lebesgue integrals are equal, i.e. $\int f = \lim \int f_n$.  This is clearly true for continuous functions, but how do I handle the case of non-continuous functions? What is the difference between topological and metric spaces? What is the difference between a topological and a metric space? Why does a window become a mirror at night? In day, when you look in the room through the window out, you can clearly see what happens outside. At night when it's dark outside but there's light inside you can look in the window but it becomes a mirror.  Why? Why are there no Pokémon near me? Why does it says "welcome back -user- click here to 'refresh page'" After logging into one Stack Exchange site, when I visit another SE site, it says to me, welcome back - user - click here to refresh - web page.   Isn't it possible to refresh the page using code &amp; without the user's interaction? I want to collect the most common mistakes, misconceptions, pitfalls, etc that (La)TeX and Friends users make. Please one answer for each mistake, misconception, pitfall, etc.  I am only interested in more technical, objective cases rather than psychological, social, subjective cases.  From this complete infinite list of technical and objective cases, we can have a reference how  to teach newbies much better directly or indirectly via writing a good book.  The technical and object cases are, for example, as follows.   Beginners sometimes use $\huge E=mc^2$ with the hope they will get a huge formula. It actually does not produce the expected result. The correct way is \huge $E=mc^2$. Beginner sometimes use longtable inside table because they assume longtable is the longer version of tabular which is able to be sandwiched in table. etc. Proving a three variables inequality Reputation widget crash I have an issue with crashing reputation widget when it's added to the home screen. When I add it for the first time, it says "Please login before using this widget" (even though the app itself is logged in already). So I open the app, go back to the home screen, add the widget again and it crashes (and it's not added to the home screen). When I'll try to add it again, it says "Please login before using this widget" again. And then it just repeats - "Please login...", execute the app, crash, "Please login...", etc.  Restart of the device didn't make any change.  I have found .  My set up:  Stack Exchange app version: 1.0.89 Android version: 5.0.1 Device: Samsung Galaxy S4 From a link from the question  to the HP Wikia, I started mulling over something I read about Voldemort and the "regeneration" potion (not a canon potion, but I'll use it for lack of a better way of describing it. . .) and would really like to know:  How did Voldemort drink the regeneration potion to turn his body into the grotesque childlike form we see in Goblet of Fire while he was still in a "mangled spectral state"?  Spectres (i.e. spirits or ghosts) are non-corporeal; they obviously can't consume food or drink liquids. So, how did Voldemort overcome this difficulty and manage to drink the regeneration potion? Getting attributes of Enum's value Finding the limit $\lim_{x\rightarrow \infty} \sqrt[3]{x+1}-\sqrt[3]{x}$ Downgrade nVidia Shield to Android 4.4 KitKat Are Love Potions legal? How to create polygons with straight lines and right angles in QGIS? When creating a polygon, how do I do it so that the lines are straight (90, 0 degrees, etc.) and when I create corners they can be right angles? For instance, how do I create a perfect square or rectangle? Is the simulation hypothesis outside of science? On the question of the  (i.e. that reality is a simulation), a friend of mine once remarked he didn't accept it on the grounds of . To me (with my admittedly instrumentalist view of science) this seems a misuse of Ockham's razor in that all my friend is really claiming is that it isn't empirically necessary (and hence outside of science).  Is the simulation hypothesis outside of science? If so, then does it pose a problem for scientific realism? If not, is it falsifiable? Is it an empirical question? Difference between "I have got" and "I have gotten" I see these two expressions are used almost identically in different contexts. Is there a difference between I have got and I have gotten?