Command works in terminal but not in bash script If I want to delete everything in the current directory except for "myfile", I can use  rm -r !("myfile")   But if I put this in a script (called cleanup):  #!/bin/bash rm -r !("myfile")   I get:  pi@raspberrypi:~/tmp $ ./cleanup ./cleanup: line 2: syntax error near unexpected token `(' ./cleanup: line 2: `rm -r !("file2")'   If I run   ps -p $$   I can see that my terminal is using bash,   PID TTY          TIME CMD 1345 pts/3    00:00:02 bash   so I'm unclear on what the problem is.    Notes:   I realize that if the script actually worked, it would delete itself. So, my script really would be something more like: rm -r !("cleanup"|"myfile"), but the error message is the same either way.  As shown by the blockquote, this is on a Raspbian OS (9 - stretch), which is Debian based. I feel like this question is bound to be a duplicate, but I can't find it. There is a similarly named , but it is in regards to inheriting variables, and so doesn't address my issue.
Copy files excluding x,y,z causing error in shell script I'm not well versed in shell scripting but I imagine this to be a painfully easy fix but its eluding me.  I need to copy the contents of a directory excluding a number of files. I have a command that works when I enter it into the terminal, but when its run in a shell script it fails with a syntax error or just doesn't work.   The command in question is:  cp -r path/to/!(dir1|dir2|dir3) destination   Any help would be greatly appreciated!
Problem with sudo apt get update: The repository cdrom... does not have a Release file Replaced wrong car in garage in GTA Online I was asked to replace a car in order to put another car in my garage. However I thought I would be able to swap the car I wanted in and take out the other car that was already in there so I could bring it to my other garage. Can I get my car back? How disk space is used on Android device? I have critical low storage level and can't understand what takes much of it and how that's possible that the installed applications can use 7 GB? I only use a few social media clients without any games or soft like Photoshop. Also on the second screenshot it indicates that the apps are using just 1.13 GB and so I can't understand the situation. Also what is the "Other"? Attempting official deploy process with single sandbox may reset/remove all existing work? I have understood how ridge regression shrinks coefficients towards zero geometrically. Moreover I know how to prove that in the special "Orthonormal Case," but I am confused how that works in the general case via "Spectral decomposition." The series had three books.  A universe of Greek gods/goddesses, set in modern time.    The gods steal Titans and force them to assume the form of infants/children, and raise them as mundanes in a boarding school type situation.  The protagonist is a young woman who discovers she can travel through the fourth and fifth dimensions as her power.  Her companions: a fey, can travel by unseen ways to various locations; a boy-shaman raised under the traditions of science, can cause anything he wants to happen simply by wishing it and tries to recreate the Michelson–Morley experiment. She ultimately discovers the true nature of the universe she is in and that the deities all follow some sort of rock-papers-scissors system where each deity has a corresponding type which he is weak to, and strong against.  What is the name of this series? Uninstalling Ubuntu from dual boot / changing bootloader I am using 64bit 2.10.1-Pisa on Windows 10.  When I set up my composer to print, everything looks fine until I try to print or export. The composer goes completely blank and outputs a corrupted PDF using the Export to PDF function. The PDF file won't even open.  I had the same result exporting to PNG.  When I try to use the PDF document printer instead of exporting, QGIS stops responding indefinitely. Why are all snaps being mounted and listed as block devices or partitions for Ubuntu 18.04? As of Ubuntu 18.04 running lsblk shows 16 snap loops (2-3 times for each snap). The question is, why are they being listed as results for lsblk, fdisf-l, and blkid?    It creates a lot of clutter from the actual disks drive partitions I need to see, namely /dev/ partitions. I know a purported duplicate of this question exists, but it only asks why three loops are being listed per snap. I want to know why these snaps are being listed in the first place, and the purported duplicate does not answer this (perhaps those marking this as duplicate could help me by explaining why it is a duplicate). Technically, they qualify as file systems (which I neither created nor asked for), but they are getting in the way of the information output for the /dev/ partitions I am interested in. This becomes a problem when fdisk -l outputs a three page+ list filled mainly with snaps.  The output of a recent (1 week old) Ubuntu install and I have not installed any snaps:    $ lsblk   NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT   loop0    7:0    0  14.5M  1 loop /snap/gnome-logs/37   loop1    7:1    0   2.3M  1 loop /snap/gnome-calculator/170   loop2    7:2    0  86.6M  1 loop /snap/core/4486   loop3    7:3    0  86.6M  1 loop /snap/core/4650   loop4    7:4    0   1.6M  1 loop /snap/gnome-calculator/154   loop5    7:5    0  14.5M  1 loop /snap/gnome-logs/34   loop6    7:6    0   3.3M  1 loop /snap/gnome-system-monitor/36   loop7    7:7    0   2.3M  1 loop /snap/gnome-calculator/178   loop8    7:8    0    13M  1 loop /snap/gnome-characters/101   loop9    7:9    0   3.7M  1 loop /snap/gnome-system-monitor/45   loop10   7:10   0 139.5M  1 loop /snap/gnome-3-26-1604/64   loop11   7:11   0   140M  1 loop /snap/gnome-3-26-1604/59    loop12   7:12   0   3.7M  1 loop /snap/gnome-system-monitor/41   loop13   7:13   0    21M  1 loop /snap/gnome-logs/25   loop14   7:14   0  12.2M  1 loop /snap/gnome-characters/69   loop15   7:15   0    13M  1 loop /snap/gnome-characters/96   sda      8:0    0 298.1G  0 disk   ├─sda1   8:1    0   512M  0 part /boot/efi   └─sda2   8:2    0 297.6G  0 part /   sr0     11:0    1  1024M  0 rom     (supplemental screen capture of above text):     My snap list shows 6 results:       core   gnome-3-26-1604   gnome-calculator   gnome-characters   gnome-logs   gnome-system-monitor     Meanwhile, gnome-disk-utility shows nothing at all for snaps, only showing my HDD and optical drive.    It won't be very efficient if every installed snap gets listed as a block device (2-3 times each to add). Should I expect future updates to deal with this?  Edit: fdisk-l also dumps out a very long list with 16 instances of these "disk loops" (Disk /dev/loop0, Disk /dev/loop1, etc., each with details which I won't show here because it's too long). This can't be intended behaviour, can it? blkid also lists 16 loops, as TYPE="squashfs". At least parted -l works as expected, only outing my actual disk partitions.    I just tested this, and installing more snaps does add more to the lsblk output. Therefore, fdisk, lsblk, blkid could have potentially huge output lists, according to the number of snaps available, and installed. What is JavaScript's highest integer value that a number can go to without losing precision? Is this defined by the language? Is there a defined maximum? Is it different in different browsers? Question Regarding Cardano's Formula In Cardano's derivation of a root of the cubic polynomial $f(X)=X^3+bX+c$ he splits the variable $X$ into two variables $u$ and $v$ together with the relationship that $u+v=X$. From this he finds that $x=u+v$, where  $$u=\sqrt[3]{\frac{-c}{2}+\sqrt{\frac{c^2}{4}+\frac{b^3}{27}}}$$ and $$v=\sqrt[3]{\frac{-c}{2}-\sqrt{\frac{c^2}{4}+\frac{b^3}{27}}}$$  is a root of $f(X)$.      Is there an intuitive explanation for why Cardano splits the variable $X$ into two parts, $u$ and $v$? Can an irrational number raised to an irrational power be rational? Can an irrational number raised to an irrational power be rational?  If it can be rational, how can one prove it? Suppose I have BaseClass with public methods A and B, and I create DerivedClass through inheritance.  e.g.  public DerivedClass : BaseClass {}   Now I want to develop a method C in DerivedClass that uses A and B.  Is there a way I can override methods A and B to be private in DerivedClass so that only method C is exposed to someone who wants to use my DerivedClass? . (See comments to the question: the OP tried to include a couple of long XML files, but that wasn't possible.)  What's the recommended approach to including code/data, when there's just too much of it to embed in the question?  I could think of a few approaches myself:   Paste the data to a pastebin and link (and wait for the links to die) Encode the (compressed) data in an image and include that (kludgy!) Implement an attachment feature in Stack&nbsp;Overflow (which will probably be abused) Fibonacci Recurrence Relations Solve the recurrence relation $f(n) = f(n − 1) + f(n − 2)$ with initial conditions $f(0)=1$, $f(1)=2.$   So I understand that it grows exponentially so $f(n) = r^n$ for some fixed $r$.  This means substituting this $r^n = r^n-1 + r^n-2$ which gives the characteristic equation of $r ^ 2 - r - 1 = 0$. I'm not 100% sure where to move on from here. How many distinct ways to climb stairs in 1 or 2 steps at a time? (Fibonacci puzzle) There is a very interesting puzzle for Fibonacci sequence:     You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb $1$ or $2$ steps. In how many distinct ways can you climb to the top?   The answer is Fibonacci sequence: $F(n) = F(n - 1) + F(n - 2)$. The explanation is that you could reach the $n$th step either from the $(n - 1)$th step or $(n - 2)$th step.  What I fail to understand is why isn't the answer $F(n) = (F(n - 1) + 1) + (F(n - 2) + 2)$. Since, after reaching $(n - 1)$th step I have to take $1$ step to reach the $n$th step and after reaching $(n - 2)$th step I have to take another $2$ steps to reach the $n$th step.  I know I might be ignoring some very stupid detail but it's better to ask and be called a fool once than to remain a fool forever. Python/Matplotlib - Is there a way to make a discontinuous axis? How do I create bookmarks with pdfLaTeX? I'm using MiKTeX and using pdfLaTeX. I can generate the PDF, but there are no bookmarks. In the .tex-file it is using:  \chapter \section \subsection   (with labels)  I originally used make with sphinx to output LaTeX. It must work somewhat or I wouldn't get the PDF. When I say bookmarks, I mean when you are in Acrobat and the left side has the Bookmarks panel.  I am reading   But I am not sure where to apply this.  EDIT:  I applied this, \usepackage{bookmark}, and got bookmarks, but I never get the subsection bookmarks. If two coins are flipped and one gets head, what is the probability that both get head? How to set a short password on Ubuntu?