I'm trying to write a bash script to prompt a user for a filename, and if the file exists, allow them to overwrite or append the file.  For some reason, I keep getting returned with a syntax error despite having an issue.  Unfortunately, I am not as familiar with Bash as I am with Python, and find myself confusing the syntax of the two.  Nevertheless, please see below:  #!/bin/bash echo "Please enter the name of your destination file: " read destFile if [ -f "$destFile" ]; then     echo "This file exists." fi echo "Please enter the name of your source file: " read sourceFile echo "Do you want to 1) Overwrite, 2) Append, 3) Exit?" echo "Please select your option: " options=("Overwrite" "Append" "Exit") while [ -e "$sourceFile" ]; do     select opt in "${options[@]}"; do         case "$opt" in         "Overwrite")             cp "$sourceFile" "$destFile"             echo "Copy Completed."               ;;         "Append" )             cat "$sourceFile" &gt;&gt; "$destFile"             echo "Append Completed."             ;;         "Exit" )             echo "Script Terminated"             break             ;;         esac         break     done done
Is there any way to debug bash script without using echo and logging?  I'm talking about using breakpoints and stuff like that.
Let $A$ be a non-empty set and $n$ be the number of elements in $A$, i.e. $n:=|A|$.  I know that the number of elements of the power set of $A$ is $2^n$, i.e.  $|\mathcal{P}(A)|=2^n$.  I came across the fact that exactly half of the elements of $\mathcal{P}(A)$ contain an odd number of elements, and half of them an even number of elements.  Can someone prove this? Or hint at a proof? Show that the polynomial $X^5 + X^3 + \bar{1}$ in $(\mathbb{Z}/2\mathbb{Z}[X])$ is irreducible Show that the polynomial $X^5 + X^3 + \bar{1}$ in $(\mathbb{Z}/2\mathbb{Z})[X]$ is irreducible. (Hint: if it were reducible, it would either have a root or be of the form $g(X) \cdot h(x)$, where deg$g(X) = 2$ and deg$h(X) = 3$) Recall that $\bar{a}$ is shorthand for the coset $a + 2\mathbb{Z} \space $in$ \space (\mathbb{Z}/2\mathbb{Z})[X]$ (for any $a \in \mathbb{Z}$)  This question is worth $7$ marks out of a possible $75$, this is my solution..  $f(X) = X^5 + X^3 + \bar{1}$ is irreducible in $\mathbb{Z}/2\mathbb{Z}[X]$ iff it has no roots in $\mathbb{Z}/2\mathbb{Z}$. Since $f(\bar{0}) = \bar{1}$ and $f(\bar{1}) = \bar{1}$, it follows that $f(x)$ is irreducible in $\mathbb{Z}/2\mathbb{Z}[X]$.  Would this be a sufficient answer? am I missing something? If photon energies are continuous and atomic energy levels are discrete, how can atoms absorb photons? If photon energies are continuous and atomic energy levels are discrete, how can atoms absorb photons? The probability of a photon having just the right amount of energy for an atomic transition is $0$. Dryer Outlet - 4 prong to 3 prong Our new dryer has 3 prongs vs. 4. We are changing to the new 3 prong dryer outlet, but want to make sure we are grounding. The wires coming from the wall our white, red &amp; black - the the copper wire. Do I need to ground it?? Thank you! Molly This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. See  for more information.   This is a community wiki for IDEs available on Ubuntu. Please post one IDE per answer (including more than just a screenshot or a link, please at least put a short description).  In your answer, tell us what the IDE is for (which language(s) or if it is RAD capable). Regression: Transforming Variables When transforming variables, do you have to use all of the same transformation? For example, can I pick and choose differently transformed variables, as in:   Let, $x_1,x_2,x_3$ be age, length of employment, length of residence, and income.  Y = B1*sqrt(x1) + B2*-1/(x2) + B3*log(x3)   Or, must you be consistent with your transforms and use all of the same? As in:   Y = B1*log(x1) + B2*log(x2) + B3*log(x3)    My understanding is that the goal of transformation is to address the problem of normality. Looking at histograms of each variable we can see that they present very different distributions, which would lead me to believe that the transformations required are different on a variable by variable basis.   ## R Code df &lt;- read.spss(file="http://www.bertelsen.ca/R/logistic-regression.sav",                  use.value.labels=T, to.data.frame=T) hist(df[1:7])      Lastly, how valid is it to transform variables using $\log(x_n + 1)$ where $x_n$ has $0$ values? Does this transform need to be consistent across all variables or is it used adhoc even for those variables which do not include $0$'s?  ## R Code  plot(df[1:7]) How do you join on the same table, twice, in mysql? I have 2 tables. One (domains) has domain ids, and domain names (dom_id, dom_url).  the other contains actual data, 2 of which columns require a TO and FROM domain names. So I have 2 columns rev_dom_from and rev_dom_for, both of which store the domain name id, from the domains table.  Simple.  Now I need to actually display both domain names on the webpage. I know how to display one or the other, via the LEFT JOIN domains ON reviews.rev_dom_for = domains.dom_url query, and then you echo out the dom_url, which would echo out the domain name in the rev_dom_for column.  But how would I make it echo out the 2nd domain name, in the dom_rev_from column? Particle speed and density I am using a Particle system to simulate falling dust / debris. The particle start and end fairly quickly. They should look like a short burst of falling dust.  I cant figure out how to get the particles to fall at slightly different speeds.  The particles should be falling downwards with very little Brownian motion.  The fact that the particles are falling at the same speed makes them look odd / too uniform (almost like a static image of some particles which is moving down rather than individual particles.  Also the particles end at a set frame so I get a uniform trailing edge (as below).   A bit of air drag helps a bit but not much.  Question 1. how to vary the downward speed of the particles?  Question2. Can the density of particles be animated so I can brake up the distribution?  Thanks Oliver Expression for a choice which isn't really one When to use icons vs. icons with text vs. just text links? Are there any rules on when to use icons vs. icons with text vs. just text links in a web application?  For example:    vs.   save  vs.  save    Extra question: Is  save -or- save  preferable? How to break out of multiple loops? A friend asked me to help her with her old iPhone 4 (she has upgraded to a 7). When I turn it on, it says, "iPhone is disabled" and "connect to iTunes."  When I do so, iTunes reports that it is locked with a passcode, and that I need to type that in to continue. However, the iPhone does not display a keypad or allow any sort of input.  Apple suggests the only solution is a wipe, but this will lose all of her photos.  Can photos be retrieved (at a minimum) from a disabled iPhone 4? Is $\sum\limits_{n=1}^{\infty}\frac{n!}{n^n}$ convergent? Don't understand proof that interior of a set is open I want to start a modal operator by clicking a button in a panel in the properties region. It should then stop when I click somewhere in the 3D viewport. I want to execute some code when I start and finish the operator (see the code below). I tried modifiyng the modal operator template with an execute method to start the modal operator. But the now the context.space_data.type is always &quot;PROPERTIES&quot; because that's where the panel is located, I guess. Is this a bad way of doing what I want? class MY_OPERATOR_OT_click_on_3dview(bpy.types.Operator):          bl_idname = &quot;mesh.click_on_3dview&quot;     bl_label = &quot;Click on 3D&quot;      def modal(self, context, event):                  if context.space_data.type != 'VIEW_3D':             return {'PASS_THROUGH'}                  if event.type in {'MIDDLEMOUSE', 'WHEELUPMOUSE', 'WHEELDOWNMOUSE'}:             # allow navigation             return {'PASS_THROUGH'}         elif event.type == 'LEFTMOUSE':             # DO ALL THE POST-SELECT STUFF             return {'FINISHED'}         elif event.type in {'RIGHTMOUSE', 'ESC'}:             return {'CANCELLED'}          return {'RUNNING_MODAL'}      def execute(self, context):         # DO ALL THE SETUP STUFF           context.window_manager.modal_handler_add(self)              return {'RUNNING_MODAL'}            def cancel(self, context):         print(&quot;CANCEL???&quot;) Correct ssh config file settings to tunnel to a 3rd machine I'm trying to tunnel to a server via a bridge server. So far, I've been able to get it working from the command shell properly using the following command:  ssh -A -t bridge_userid@bridgemachine.com ssh -A remote_userid@remoteserver.com   But I've been trying to wrap this into my ~/.ssh/config file and I have troubles. I've tried:  Host axp   User          remote_userid   HostName      remoteserver.com   IdentityFile  ~/.ssh/id_rsa.eric   ProxyCommand ssh -A -t bridge_userid@bridge_userid.com ssh -A remote_userid@%h   But when I do, I get the following error message from remoteserver.com and I'm not sure what is causing it:     ksh: SSH-2.0-OpenSSH_6.8^M:  not found   I know that when I log into remoteserver.com , my shell is /usr/bin/ksh.  I've tried to add path arguments to the ssh commands in the config file, but it made no difference.  Any ideas what it can be? How is Cooper's age justified? Domain Controller etiquette after a crash between Server 2003 & Server 2008 I have 2 domain controllers on a non-Internet connected network running Windows Server 2008 R2. They running RAID 5 on a 8 Hard Drive server. Sometime last week the Boot Sector became corrupt on DC1 and I was unable to recover the server. I am not going to have to rebuild the server. I have been reading about the changes from Server 2003 to Server 2008. DC1 was the main domain controller and now that it won't but it is all falling to DC2. I know that in previous versions of Windows Server you had to make on the primary and one the secondary. Since DC2 does not see DC1 anymore is there anything I need to do to DC2 as it is now the one in control? I am thinking some kind of meta data clean up but I can't find any hard information on what procedure to do. I understand as of Server 2008 domain controllers are on an equal footing and provide replication to each other so they should be the same correct? I've got a situation where I have a 240V 30A dryer line, and I want to power something else from the same circuit, but NEVER at the same time as the dryer. I'm looking for a switch to use, like a DPDT ON-ON break-before-make switch. There are tons of DPDT switches I've found, and most seem to be ON-OFF. Hardly any show their wiring diagrams, so if they don't give more details, I don't know if they'll work. Note: the second circuit will not use more than 15A, maybe just 12A.  I'm hoping someone can recommend specific switches that will do what I want. Manufacturer and exact part# is what I'm looking for.   Personally, I don't care if it's a knife switch, something that looks like a standard light switch, two buttons, has relays, I don't care. The breaker box is full, it's a long and difficult wire run, and I do not need a separate circuit because I'll NEVER need to run both devices at once.  I could resort to just using one plug and unplugging one then plugging the other one in, but I don't see the point of constantly exposing live wires (the plugs) where something could inadvertently fall on them or water could be sprayed, instead of keeping things all sealed in the wall with a safe, simple switch between two plugs. Reputation graph not interactable with a touch screen