I have had this function I use it very often and it works fine.  Here it is:  cdx () { cd `dirname $1` ; }   However, this does not work with spaces. When I use it like this for example  cdx ~/desktop/folder/file\ file   It returns  usage: dirname path   But what I am passing is, essentially dirname path. So what am I supposed to do to fix this? (It also does the same thing when there are spaces in a folder names)  My first thought was using quotes, like  cdX "directory\ whatever" but it did not work either.
Or, an introductory guide to robust filename handling and other string passing in shell scripts.  I wrote a shell script which works well most of the time. But it chokes on some inputs (e.g. on some file names).  I encountered a problem such as the following:   I have a file name containing a space hello world, and it was treated as two separate files hello and world. I have an input line with two consecutive spaces and they shrank to one in the input. Leading and trailing whitespace disappears from input lines. Sometimes, when the input contains one of the characters \[*?, they are replaced by some text which is is actually the name of files. There is an apostrophe ' (or a double quote ") in the input and things got weird after that point. There is a backslash in the input (or: I am using Cygwin and some of my file names have Windows-style \ separators).   What is going on and how do I fix it?
Let $\Omega=\mathbb{N}$. For each $E\subset\Omega$ let $N_n(E)$ be the cardinality of the set $E\cap \{1,2,\ldots,n\}$. Define $C=\left\{E: \lim_{n\rightarrow \infty} \frac{N_n(E)}{n} \text{ exists}\right\}$. Show that $C$ isn't a field.  I already know that it isn't closed to finite union of non-disjoint set but I can't see why. I saw a post that somebody said &quot;the set of natural numbers whose first digit is 1 doesn't have this limit&quot;. I'm in trouble to see why this limit wouldn't exists in finite unions. Thanks in advance. If $A$ commutes with $B$ and $B$ commutes with $C$, then $A$ commutes with $C$ Let $A,B,C \in \ M(3,\mathbb{R})$ be such that $A$ commutes with $B $and $B$ commutes with $C$. $B$ is not scalar matrix. Then, $A$ commutes with $C$.   Is this true or false? I think it is not true, but cannot think of a counterexample. Any suggestions? Why would spacetime curvature cause gravity? It is fine to say that for an object flying past a massive object, the spacetime is curved by the massive object, and so the object flying past follows the curved path of the geodesic, so it "appears" to be experiencing gravitational acceleration. Do we also say along with it, that the object flying past in reality exeriences NO attraction force towards the massive object? Is it just following the spacetime geodesic curve while experiencing NO attractive force?  Now come to the other issue: Supposing two objects are at rest relative to each other, ie they are not following any spacetime geodesic. Then why will they experience gravitational attraction towards each other? E.g. why will an apple fall to earth? Why won't it sit there in its original position high above the earth? How does the curvature of spacetime cause it to experience an attraction force towards the earth, and why would we need to exert a force in reverse direction to prevent it from falling? How does the curvature of spacetime cause this?  When the apple was detatched from the branch of the tree, it was stationary, so it did not have to follow any geodesic curve. So we cannot just say that it fell to earth because its geodesic curve passed through the earth. Why did the spacetime curvature cause it to start moving in the first place? How do per-site Metas differ from Meta Stack Exchange, and where should I go to ask my question? How do per-site metas, such as Meta Writers Stack Exchange or Meta Stack Overflow differ from the general Meta Stack Exchange?  Where should I go to ask my question? Choose a default app for opening files with no extension? Is it possible to set a default application to open files with no extension?  I'm not referring to files with hidden extensions, but those completely lacking an extension -- e.g. README, CHANGELOG, mbox, etc.  "Open With" => "Change All" on these files doesn't work, returning the error shown below:    Ideally, I would like the system to try opening all such files in TextMate.  I know I can drag files onto Dock icons to open them in specific apps, but I'm looking for a more seamless solution than that (especially since I have my Dock auto-hide, which makes it much more cumbersome).  I am familiar with the  QuickLook plugin that can enable QuickLook for some of these files, but I would prefer a solution with selecting/copying/editing capabilities. round() doesn't seem to be rounding properly Filter dict to contain only certain keys? I am a new user for Ubuntu. I downloaded 13.10 yesterday and made a bootable USB with universal USB installer on my Lenovo IdeaPad Z580 laptop which is now using UEFI; everything appeared OK.  When I booted from the LiveUSB I got the choices of trying or installing Ubuntu but both of them keep giving me these error:  [ 1.929082] kernel panic-not syncing vfs unable to mount root fs on unknown-block (0.0)   Please tell me what is going wrong? Why are low-rep users rate-limited when posting questions? I just encountered the following error:  Oops! Your question couldn't be submitted because: users with less than 125 reputation can only post questions every 20 minutes; try again later.  Why do you have this rule? Why 20 minutes? Using sets of arguments from a list Why upload to academic preprint sites like arXiv? The recent question  made me realize that I don't have any understanding of why one would upload to a preprint site.  (I don't work in a field where they seem to be common.)  Why would one be concerned about getting a manuscript on arXiv, if it's already under review with a journal?   Is it because of the long publishing timeline of journals?  (That could explain why computer science &mdash; which publishes much more in conferences &mdash; doesn't seem to do much with them.) In some cases, questions and answers that have been deleted are still showing up on /review pages. They do not have "Improve" buttons, but they can still be approved or rejected. I'm not sure what causes a post to end up in this limbo state instead of being removed from the queue entirely, which I think is what's supposed to happen.  The suggested edit I noticed this on was , but it just leads to a "Page Not Found" message now.  Tim Stone provided the following screenshot of another instance : When should you push variables in quotes in boolean conditions? Are the following two boolean expressions the same?  if [ -n $1 ] ; then  if [ -n "$1" ] ; then   If not - When should you put a variable in quotes? How to tell whether a field is required or not in Apex by describe fields I own a notebook running Ubuntu 16.04 with Unity DE that does not have any keyboard LEDs to indicate NUM-Lock or CAPS-Lock states.  It would be useful for me to see them anyway, ideally through an indicator in Unity's panel.   Please note that I only want to see the states of NUM-Lock, CAPS-Lock and optionally Scroll-Lock. I do not want to see whether any other modifier keys like Shift, Ctrl, Alt, Super etc. are currently pressed. I only want a replacement for my missing LEDs.  Are there any working indicators available?    I already have read , but it does not suit my needs. indicator-xkbmod only displays a wrong icon but does not react on keyboard NUM-/CAPS-Lock status changes, kbstate is for KDE only and key-mon does not show the NUM-/CAPS-Lock states but indicates key presses to modifier keys. Showing that $\sum_{i=1}^n \frac{1}{i} \geq \log{n}$ What was the point of testing carbonite-freezing technology on Han Solo? Darth Vader tested carbonite-freezing technology on Han Solo because he didn't want to kill Luke who was precious to the emperor. But, why was it necessary? Wasn't it already a tested and proven technology? Even Darth Vader (when he was Anakin) himself used it along with others decades ago (Star Wars: The Clone Wars S03E18). For a lot of questions here on TeX.SE and on other fora regarding MiKTeX, it turns out that the underlying problem actually lies in the not understood distinction between administrative and user modes. So let me ask these questions:  What’s the difference between administrative and user mode in MiKTeX, and in which situation should I use either one of these modes? Find all possible solutions of $$2^x + 3^y = z^2.$$    My approach.   First I substituted $x = 0$, and got the solution, then for $y = 0$. And for $x &gt;  0$ and $y &gt; 0$ , I just know the Pythagorean triple and got the solution as $(4,2,5)$ and $(4,2,-5)$. Please help me to solve it properly. I have an experiment where I measure the effect of a manipulation on two different groups of participants, and the variable that I manipulate also has two levels. Thus, I can essentially use a 2x2 ANOVA to analyze the results. But it is also possible for me to measure the effect of the different levels of the variable first on Group 1 and then on Group 2, by using paired-samples t-tests.   Is there a rule of thumb to decide what needs to be done in this case? I think one advantage of using an ANOVA could be the option to investigate the interaction between the different groups and the different levels of the variable. Perhaps one could also argue that an omnibus analysis is also a better choice from a stylistic point of view.   But is there a very compelling conceptual reason to prefer a 2x2 ANOVA over two separate pairwise comparisons in my case? And if so, what would it be?