i am typing a small bash script which should clone a git repository, checkout a specific hardcoded branch and listen for some new commits. If new commits are found the script should kill a running instance of 'MyApp', do a git pull and finally build it with gradle. It should also start via gradle again.  Yes it is a java application with a gradle build file.  This is my code:  ##!/bin/bash  # GitHub Repository and Paths GLOBAL_REPOSITORY="..." LOCAL_REPOSITORY="..."  # Go to the repository cd $LOCAL_REPOSITORY  # Clone the git repository if not already done if [ ! -d "$LOCAL_REPOSITORY/.git" ] then   git clone $GLOBAL_REPOSITORY $LOCAL_REPOSITORY   git checkout dev fi  # Pull and build if there are new commits LAST_GLOBAL_COMMIT="" LAST_LOCAL_COMMIT=""  CHILDS_PID=""  while true; do   git fetch origin    LAST_GLOBAL_COMMIT="$(git rev-parse origin/dev)"   LAST_LOCAL_COMMIT="$(git rev-parse dev)"    if [ "$LAST_GLOBAL_COMMIT" != "$LAST_LOCAL_COMMIT" ]   then     if [ "$CHILDS_PID != "" ]     then       kill 9 "$CHILDS_PID" # Line 33     fi      LAST_LOCAL_COMMIT="$LAST_GLOBAL_COMMIT"      git pull origin dev      gradle      CHILDS_PID="$(gnome-terminal -e \"gradle run\" &amp; echo $!)"   fi    sleep 300 done   The problem which is occuring is that the child terminal and also MyApp are still running. Only gradle seems to die. But i want to kill all child processes and then run them again. Only the terminal which is running my script should not be killed.  In the actual situation the process tree should look like this:  Main Terminal (Running the script)     |     | Child Terminal     |     | Gradle run     |     | MyApplication   My question is how can i kill all of these processes at once except the terminal on top in line 33?  EDIT:  The difference here is that i searched for a way to find the main node of a subtree and to kill it in the second step.  But i found out if a bash instance is calling a gnome-terminal or any other terminal or tty it is making a process which will initialize a forked off terminal.  So for example terminal_1 has a PID of 42 and i launch another terminal through it then it will start a init process with a PID of 43 which will initialize the terminal_2 which will have a PID of 44. But the terminal_1 gets only the 43 as a return value. After this the init process dies and if you try to kill PID 43 it logically says that there is no process with that PID.  At this point is tracking not possible and i solved my issue by writing a c program which uses fork at its own.
I want to kill a whole process tree.  What is the best way to do this using any common scripting languages? I am looking for a simple solution.
How to edit files in a terminal with nano? Splitting a large document into several files Error -504 on appliation installation Yes. I've read all other questions regarding this problem. Like this one:  It's the same problem as this one but with more background information and an other app:   The details: My device is an Ulefone Be Touch 2 running Android 5.0.  My connection is perfect. To be sure I tried different networks, among them are 3G, 4G and wifi on ADSL, VDSL, cable and fiber. I've also used Tor and 3 different VPN providers in 3 countries on 2 continents. Let's say I ruled the network out.   A single app does not install: OpenKeychain.  Currently I have 126 apps installed. It does not install via desktop browser > play store > install button.    I have enough free space (40GB). The app is 7MB.   Re-adding Google account and clearing caches did not work.    Even a complete device wipe and re-install didn't work.     Downloaded the apk and tried manual installation, same error.   I also own a Nexus 7 (2013 wifi) and the app installs fine on that device. Why would you use an assignment in a condition? In many languages assignments are legal in conditions. I never understood the reason behind this. Why would you write:  if (var1 = var2) {   ... }   instead of:  var1 = var2; if (var1) {   ... } I am using wp_get_attachment_image_src to construct the srcset attribute of an img tag. In that attribute I want to output a comma separated list of image urls along with the image widths.  Using the Media Settings page, I have configured the image sizes to be as follows:   Thumbnail size: 150x150 Medium size: 640x480 Large size: 1024x768 Small size: 278x320   The wp_get_attachment_image_src function returns the correct urls and the correct widths for the image sizes full, medium and small. small is a custom size I added using add_image_size.  If I call wp_get_attachment_image_src( $image_id, 'large' ), the returned array looks like this:  array (     0 =&gt; 'http://localhost/wp-content/uploads/2014/10/image-1024x768.jpg',     1 =&gt; 640,     2 =&gt; 480,     3 =&gt; true, )   Checking the image which can be found at that url turns up the image with the correct dimensions.  Currently i am using the php builtin function  to circumvent this problem, but this function call takes significantly longer than simply accessing the index returned by wp_get_attachment_image_src:  Without getimagesize (mtime before and after execution):   '0.83761000 1415195440' '0.83831600 1415195440'   With getimagesize:   '0.34808000 1415195635'  '0.35323900 1415195635'   What can I do to make wp_get_attachment_image_src return the correct dimensions? I've used git clone to make a local copy of a GitHub repository containing a  I'd like to use. The local copy contains all of the source for the program; but as a newbie to Ubuntu, I've no idea of what tools or steps are involved in compiling and installing the driver.   I'd really appreciate if anyone could provide a step-by-step guide? Explain the xkcd jelly bean comic: What makes it funny? Blender 2.80 system Req + GPU req Can someone please let me know the minimum system requirements and GPU requirement to run blender 2.80 and eevee smoothly?   Also please let me know the optimum system requirements for the purpose of    environment modeling Game development charachter modelling and animation   Also if someone can suggest me a good desktop/laptop for personal use that is compatible with blender 2.80 in a low budget.  Any help will be much appreciated.  Thanks in advance! Is this a grammatically correct line in a poem: “Will he roll the dice, and follow it to Vegas?”? I want to use the following line in a poem: "Will he roll the dice, and follow it to Vegas?"   A couple of things to note; firstly, obviously I'm using "roll the dice" in both a figurative/idiomatic sense (as in taking a risk), and in a somewhat more literal sense (painting the image of the person actually following the dice that have been rolled to Las Vegas). That being said, my confusion here is if I can get away with using "follow it" or if I need to say "follow them" .... As I've read online "dice" traditionally refers to more than one die (i.e., the plural of die), but in the modern usage, "dice" can also be used to refer to the singular (i.e., just one die).   So, it seems like if I was referring to the image of just one die, then the way I phrased it could be correct. However, the image I'm trying to paint is the one usually associated with the phrase "roll the dice" (i.e., rolling two dice)...   So could "follow it" still be considered acceptable in this sense... or would I need to use "follow them"?... And if not referring to the dice themselves, could using, could the "it" be taken to refer to the act of rolling the dice, or would that not work either? Thanks so much in advance!! This is a problem from Rudin's Functional Analysis:  Show that there is a sequence of functions $\{ f_n \}$ in $X$ (the vector space of all complex functions) such that $f_n \to 0$ pointwise, but if any sequence $\{ \gamma_n \}$ tends to $\infty$, $\gamma_n f_n \not\to 0$.  The hint says to use the fact that the collections of all complex sequences converging to $0$ has the same cardinality as $[0,1]$. Honestly, this confused me more than it helped me.  My main issue is through the method of showing existence: I am not sure if I should attempt to construct an explicit sequence $f_n$, or if I need to appeal to other nonconstructive means such as Zorn's Lemma, etc. I have been trying to construct clever choices of sequences for a good bit now, but it always seems like I will be able to find a sequence that diverges slowly enough to allow that $\gamma_n f_n \to 0$.   Thanks! As of today, a  has been found affecting versions 1.0.1 through 1.0.1f (inclusive) and 1.0.2-beta.  Since Ubuntu 12.04, we are all vulnerable to this bug. In order to patch this vulnerability, affected users should update to OpenSSL 1.0.1g.  How can every affected user apply this update now? To find all $n$ such that $(n-1)!+1$ is a perfect power of $n$ How can I detect when an Exception has been thrown anywhere in my application?  I'm try to auto-magically send myself an email whenever an exception is thrown anywhere in my Java Desktop Application.  I figure this way I can be more proactive.  I know I could just explicitly log and notify myself whenever an exception occurs, but I'd have to do it everywhere and I might(more likely will) miss a couple.  Any suggestions? Travelling as an unmarried Western couple in Indonesia Consequences of a master thesis with errors I finished my master thesis 6 years ago, since then I gained a lot of experience on my field and also in academia. I can say that in that time I was a "child" , very inexperienced. I think that also my advisor did not help a lot, and I tried to do  a lot of things by my own, without someone to really review my things. Despite that, I still received a good mention by the master committee on final results.   Some days ago, I just decided to read part of master thesis, and I just realized a big nightmare coming. I identified a lot of typos, some references errors, and some improvements that I should do, but I did not. The worst thing is that I wrote a paper to a conference with my master thesis results (and some errors are there). The conference is not a high impact conference, but still the paper has my name and is available for everyone...   As I am finishing my PhD studies for now, I am concerning a lot that situation. My dream and goal is to pursue a Professor career. So, my questions are: What are (or could be) the consequences of a master thesis and paper with errors (some minor and some major) in academia? Revoke degree after years by errors in master is possible ( I am concerning a lot this situation that I thought on it)? How can I minimize it (I thought that I can put a fixed version of my thesis and paper in the future, for instance on my personal website)? How those errors can impact me in a Professor recruitment process?  Sorry for the long text, I am blaming myself all the time, and really afraid about the possibilities since I know that Academia career is really competitive. I have a hard time finding a how-to.  I would like to set up a simple ESD mat and wrist wrap, but I am not sure about is the the 1 MOhm resistor should be, if at all.  Several options:   1 MOhm from ground outlet to the mat, wire from the common earthing on the mat to the wrist wrap. 1 MOhm from ground outlet to the mat, wire from another contact on the mat to the wrist wrap. 1 MOhm from ground outlet to the mat, 1 MOhm from the same mat contact to the wrist wrap. wire from ground outlet to the mat, 1 MOhm from the same mat contact to the wrist wrap. wire from ground outlet to the mat, wire from another mat contact to the wrist wrap.   I am not sure why the 1 MOhm wire is needed since the mat itself already has that kind of resistance (as long as the wrist wrap does not connect to ground directly, but through the mat).  Which solutions above are ok? Which is best? Should I do something else instead? Is there any significant difference between Nikon and Canon? How to properly denoise renderings? Since the Denoise feature was added to Blender I only use the default setting with it and it really does the work. But sometimes the denoise is noticable on some of my renders. How can I overcome the blurred effect? Denoising for me is a big help because my system is quite aged. I'm stuck at this algebra problem, it seems to me that's what's provided doesn't even at all.  Provided:  $$a+b+c=0$$  Find the value of:  $$\frac{a^2}{2a^2+bc}+\frac{b^2}{2b^2+ac}+\frac{c^2}{2c^2+ab}$$  Like I'm not sure where to start, and the provided clue doesn't even make sense.  There's no way I can think of to factor this big polynomial into a form like $a\times p+b\times q+c\times r=s$ where $p,q,r,s\in\mathbb{Z}$.  Thanks! I understand that the output voltage is determined by the ratio between the two resistor values, and that if the both resistors are same then output voltage will be exactly same for all; but what's the basis of picking the resistor values?there is any need of consider output current to choose resistor value.