My intended goal is to create a script that when run, will check the state of a setting, then change it to the opposite state. The setting in question is regarding the manual or disabled state of proxy settings in Ubuntu's settings.  I can manually obtain the state of this setting with the command:  gsettings get org.gnome.system.proxy mode   This will return auto, manual, or none. I don't use the first state, so let's ignore that from here on. Now, once the state is returned, my goal with the script is to then run either one of the following commands:  gsettings set org.gnome.system.proxy mode 'manual' gsettings set org.gnome.system.proxy mode 'none'   The command it runs will be the state not currently set. To that end, I have attempted the following in a script:  if [ 'gsettings get org.gnome.system.proxy mode' = 'none' ] then gsettings set org.gnome.system.proxy mode 'manual' notify-send "Manual" else if [ 'gsettings get org.gnome.system.proxy mode' = 'manual' ] then gsettings set org.gnome.system.proxy mode 'none' notify-send "Disabled" fi fi   This is saved in a file with chmod +x applied. When run from the terminal, nothing happens. I just get a new line to await a new command.  Where have I gone wrong?  In addition, is it possible to get this to work on a single line, like so:  sh -c "if [ $(gsettings get org.gnome.system.proxy mode) = \"'none'\" ];then gsettings set org.gnome.system.proxy mode 'manual' &amp;&amp; notify-send \"Manual\";elif [ $(gsettings get org.gnome.system.proxy mode) = \"'manual'\" ];then gsettings set org.gnome.system.proxy mode 'none' &amp;&amp; notify-send \"Disabled\";fi"   Again, same (lack of) results.
I want to monitor the output of a command and whenever it contains a certain string I want to run another command.  Example: when command1 outputs 1234 I want to run command2
How do I get a list of all subdomains of a domain? I want to find out all the subdomains of a given domain. I found a hint which tells me to dig the authoritative Nameserver with the following option:  dig @ns1.foo.bar some_domain.com axfr   But this never works. Has anyone a better idea/approach In Windows there’re perhaps only a couple of important folders (by important I mean important in my logical picture of the Windows file system) in the installation drive (in my case C:\). Namely Program Files and Windows. I simply stay away from Windows folder and the “add remove program files” is good enough to handle the program files folder of Windows. Of course there’s a folder named Users where the users (who are not admins) can access only their folders.  Thus there’s a clear picture at some level in my mind of the Windows file system. In Ubuntu, when I reach the location /, there’s a huge list of folders, most of which I have no clue as to what they contain. The /bin folder seems to be the equivalent of the Windows folder in windows. The /usr folder seems like it’s the equivalent of the Users folder in Windows. But even the /home folder looks like it can fit the bill.  Please understand that I do understand, that Ubuntu (Linux) has a different character than that of Windows, i.e., there need not be exact equivalent of Windows functions, in Ubuntu. All I am looking for is a bit more clearer picture of the Ubuntu file system.   This question is a part of a bigger question which I am splitting up to make it more answerable. The original question can be found here: Array initialization syntax when not in a declaration ref to subsection number only How can I define a custom listing environment? I am trying to define an enviroment for a specific programming language, F#. Here's my code:  \definecolor{bluekeywords}{rgb}{0.13,0.13,1} \definecolor{greencomments}{rgb}{0,0.5,0} \definecolor{turqusnumbers}{rgb}{0.17,0.57,0.69} \definecolor{redstrings}{rgb}{0.5,0,0}  \lstdefinelanguage{FSharp}     {morekeywords={let, new, match, with, rec, open, module, namespace, type, of, member, and, for, in, do, begin, end, fun, function, try, mutable, if, then, else},     keywordstyle=\color{bluekeywords},     sensitive=false,     morecomment=[l][\color{greencomments}]{///},     morecomment=[l][\color{greencomments}]{//},     morecomment=[s][\color{greencomments}]{{(*}{*)}},     morestring=[b]",     stringstyle=\color{redstrings}     }  \newenvironment{fslisting}   {     \lstset{         language=FSharp,         basicstyle=\ttfamily,         breaklines=true,         columns=fullflexible}     \begin{lstlisting}   }   {     \end{lstlisting}   }   Then I'm trying to use it as such:  \begin{fslisting} type 'a Process = 'a Signal IObservable \end{fslisting}   But it doesn't work. The output log says that the listing is not terminated - or is terminated by the document. So the rest of the document is also formatted as a listing, which is of course not the intention.  What am I doing wrong here? Drawing Day and Night on a Google Map I'm looking to plot day/night on a Google map, for an arbitrary point in time. I'm familiar with generating map tiles; I'm just looking for an algorithm to tell me whether a particular point on the globe is currently in daylight or darkness, or to otherwise plot the curve of the day/night interface onto the map.  I've done some searching, but it's possible I don't even know enough about the problem domain here to know what terms to search for!  Any ideas? Doesn't have to be perfect -- basically, I'm comparing Flickr geolocation data of sunrise and sunset photos (and their "date taken" timestamps) with reality, and this is to help me visualise it. "Communicate over" vs. "communicate through" Also schemas can communicate over database links to schemas in other remote databases.    Could one replace the preposition over with through? Will it change the meaning, and if so, when should we use over instead of through? What do we mean by hyperparameters? We've drastically simplified the user deletion process! Prevent ligatures in Safari (Mavericks/iOS7) via CSS Money transfer from India to USA My daughter is a US Citizen. We (parents)are also planning to permanently settle in US. We will go their as Permanent Resident,as per US Law. We have a house here in India worth Rs.2 Crores.  We want to sell it and take money with us. We have ordinary savings Bank account here in India.  My US Citizen Daughter is a Income Tax payer.  Now your advises are required as under:   What are the routes to take money from India to US and our tax liabilities Can I gift this whole amount to my US Citizen Daughter or what is the maximum limit of Gift amount.  What will be the tax liability on me and on my Daughter in case of Gift   Whether I have to show it in my Income Tax Return or in my Daughter's Tax Return. What US Income Tax Laws says. What will be the procedure to send money as Gift to my Daughter. Will the money will go directly from my Bank Act.to my Daughter's Bank Account. Will there will be wire transfer from bank to bank Can I send money through other money sender Certified Companies also.    Please advise. If there is something more on the subject to make me understand, please advise. Thanks, At which moment does the 'Surprised' state disappear? I have the amulet of Mara but when I go to talk to maramal about a wedding nothing shows up. WHY is that. How does the twitter bot work? Must $k$-subalgebra of $k[x]$ be finitely generated? I don't have cd burner, so I want to install W7 on my 2nd computer via an USB-Drive. I just copied the files from the iso but it won't boot. So I installed ms-sys and did a ms-sys -7 /dev/sdb but it just says "Boot error".  How can I install it the right way? Tried many different tutorials by now but none worked. How do I pass this array of c strings correctly? Examples of Bayesian and frequentist approach giving different answers Note: I am aware of  differences between Bayesian and frequentist statistics. For example &quot;what is the probability that the coin on the table is heads&quot; doesn't make sense in frequentist statistics, since it has either already landed heads or tails -- there is nothing probabilistic about it. So the question has no answer in frequentist terms. But such a difference is specifically not the kind of difference I'm asking about. Rather, I would like to know how their predictions for well-formed questions actually differ in the real world, excluding any theoretical/philosophical differences such as the example I mentioned above. So in other words: What's an example of a question, answerable in both frequentist and Bayesian statistics, whose answer is different between the two? (e.g. Perhaps one of them answers &quot;1/2&quot; to a particular question, and the other answers &quot;2/3&quot;.) Are there any such differences?  If so, what are some examples?  If not, then when does it actually ever make a difference whether I use Bayesian or frequentist statistics when solving a particular problem? Why would I avoid one in favor of the other? Infinite Product $\prod\limits_{k=1}^\infty\left({1-\frac{x^2}{k^2\pi^2}}\right)$ Apt-get update with an @ in password error