I am testing out Expect to get a basic template working. I have created a demo bash script which asks a few questions and outputs the inputs to a file.  When I execute the .exp file directly or through "expect FILENAME", or even when using autoexpect, I get the errors below that suggests it was not interpreted correctly(expected .exp file?). What should I do to get Expect with a bash script working?   I am testing using Ubuntu through WSL as the OS and CMD(bash is executed to use WSL and normal bash commands usable so not sure if this has any effect.).   Expect file:  #!/usr/bin/expect -f  set timeout -1  spawn /bin/bash "./test-interactive.sh" # expect "*" expect "Please fill in each prompt." send -- "a\r" expect "*" send -- "b\r" expect "Please fill in each prompt." # expect "*" send -- "c\r" expect "*" send -- "d\r" expect eof   Bash shell file:  #!/bin/bash  _message="Please fill in each prompt."  echo $_message  read a read b  echo $_message  echo -n "$ " read x echo -n "$ " read y  echo "" echo "Accepting following inputs" echo $a echo $b echo $x echo $y echo ""  echo "a: $a b: $b x: $x y: $y" &gt; output.txt  # read -p "Press enter to exit"   Output:  spawn /bin/bash ./test-interactive.sh ./test-interactive.sh: line 2: $'\r': command not found ./test-interactive.sh: line 4: $'\r': command not found Please fill in each prompt. a b ./test-interactive.sh: line 6: $'\r': command not found ': not a valid identifierne 7: read: `a ': not a valid identifierne 8: read: `b ./test-interactive.sh: line 9: $'\r': command not found Please fill in each prompt. c d ./test-interactive.sh: line 11: $'\r': command not found ': not a valid identifierne 13: read: `x ': not a valid identifierne 15: read: `y ./test-interactive.sh: line 16: $'\r': command not found  Accepting following inputs
I use Cygwin on my laptop (DOS). I have a collection of scripts from my colleagues, and my own. I am not an IT person, not knowledgeable in Unix. I am following my colleagues' syntax and able to manage a few simple things. The scripts worked well on my old laptop. I just changed laptop and installed Cygwin. When I run my scripts, they do not work. Here is one example of the error message I get: line 1: $':\r': command not found line 5: syntax error near unexpected token `$'\r'' line 5: `fi  Here are the top 5 lines of my script : iter=1 if [ -f iter.txt ]    then rm ./iter.txt  fi    Can someone please explain how I can get around this problem?
Exclude a view from master layout? The batcave, in any version of Batman, is large.  Plus there's the batmobile, which required special construction, plus the batcomputer and numerous other batwidgets.  How did a good sized batcave get built without the land above it being torn up and without requiring a huge construction crew?  And, after the cave was built, how was the batmobile built in secret, without someone involved in it being able to make the connection between the car they built and the one that shows up in the news when Batman is first seen?  (While he's in Gotham, a masked vigilante is news that would end up nation wide.)  There would also be the need for secrecy so vilains can't find out how it is built and what the specs are.  And then there's the continual supply of batwidgets.  Just as with the batmobile, there's the need for these items and how they work to be kept secret.  It'd take several factories to produce all that Batman uses and major construction for any batcave I've seen (which is in movies and on TV).  How is all this done in secret?  (Or is there a trail of bodies?) Prove that if a number $n > 1$ is not prime, then it has a prime factor $\le \sqrt{n}$. du not accounting for space shown by df I have a CentOS 7.2 (minimal) VM running in a vSphere cluster, which has a 16G drive formatted as XFS under the default full-disk usage partitioning scheme from the CentOS installer. The system is running a test httpd service (all software from the default centos repos), but its space usage on disk is growing. This is in part from problematic apache error/access logs (2+GB in size), and removing these longs frees up some space. What is eating the drive space isn't so much a concern for me (I'll just nuke and pave this eventually). However, when I run df an du to check file sizes, I get a discrepancy and this is what's confusing.  First I run df -h to view filesystem usage:  [root@svrhttp03 httpd]# df -h Filesystem                         Size  Used Avail Use% Mounted on /dev/mapper/centos_svrhttp03-root   14G  4.8G  9.1G  35% / devtmpfs                           902M     0  902M   0% /dev tmpfs                              912M     0  912M   0% /dev/shm tmpfs                              912M   97M  816M  11% /run tmpfs                              912M     0  912M   0% /sys/fs/cgroup /dev/sda1                          497M  169M  329M  34% /boot tmpfs                              183M     0  183M   0% /run/user/0   This is showing 4.8G used on the root FS.  I then run the following to view the size of all items at the root of the filesystem:  [root@svrhttp03 httpd]# du -a -h -t 10K / 2&gt; /dev/null | grep -v -E "[A-Z,a-z,0-9]/." | sort -h 16K /home 7.4M    /root 31M /etc 97M /run 143M    /boot 324M    /var 1.3G    /usr 1.9G    /   This shows only 1.9G in use, and the reported size of all directories add up to ~1.9G, as expected.  So how can I find that ~2.9G discrepancy between what df and du are claiming for data on disk? I have no idea how to prove that the set $\{(x, |x|): x\in\mathbb{R}\}$ is not the image of an immersion of $\mathbb{R}$ into $\mathbb{R}^2$  For example   If $f(t)=(t^3, |t|^3)$ then $f'(0)=(0, 0)$. How do you increase MAXSYMLINKS In a python script, I am creating a bunch of symbolic links chained together.  example: link1->link2->link3->.......->somefile.txt  I was wondering how you can change the max number of symlinks to be greater than 20? If a group mod its commutator subgroup is cyclic, then the group is abelian? Let $G$ be a group and let $G'$ denotes its commutator subgroup, that is the group generated by all elements of the form $g^{-1}h^{-1}gh$.  Is the following true:      If $G/G'$ is cyclic, then G is abelian.   Recall that the claim is true for the $G$ modulo the center of $G$.  See In Windows, 'removable' drives cannot be partitioned, without the partitions not appearing and receiving drive letters, apart from the first partition.  Partitioned flash drives work fine in Linux.  What I want to do is partition a 8GB flash drive into two, with the first partition containing various boot disc images, which can be selected to boot from, and have various portable apps, documentation, utilities, scripts, etc, on the other partition.  I currently do this using two separate flash drives, but I want to be able to use a single flash drive for everything, which I keep on my keyring.  It is not possible to do this without having at least two partitions, as the ISO boot selector for the boot disc images will not work otherwise.  I know there is a method where you can flip a bit, using Lexar's USB Format Tool, which fools Windows into thinking that the partitions are on a fixed hard drive.  However, this apparently makes it difficult to eject the flash drive.  Flash drives with  from SanDisk had two partitions, presenting itself to the host system as a USB hub with a CD drive and standard USB mass storage device attached.  This is what I would like to emulate, if possible. Was the significance of Arya's Braavosi coin ever explained? Jaqen H'ghar gives Arya the iron coin, she can apparently give it to any Braavosi and say Valar Morghulis and that gets her where she needs to go, but why?    Where do these coins come from and what do they indicate to a Braavosi? The set of homotopy classes What is causing disabled options when adding a mesh/curve object to the scene? Sometimes when adding an object to the scene I see that all options (on toolbar or in window after pressing F6) are disabled. Can anyone tell me when can this happen? What is causing it and how to revert it - make it enabled again. It worked for me when I restarted Blender and reloaded the scene. However I would really like to know what can cause it? Can I concatenate multiple MySQL rows into one field? I need to create an edit component for an SObject from which I do not know the objectApiName at design time. I only know the Id of the SObject. objectApiName could be any valid SObject-name.  Now I want to use lightning:inputField   This needs to be wrapped by lightning:recordEditForm  In case I hardcode it to "Order", provide a vaild Order Id and let the controller load the order and assign it to the Parent-attribute, this works flawlessly:  &lt;aura:attribute name="recordId" type="String" default="" /&gt; &lt;aura:attribute name="Parent" type="SObject" default="{}" /&gt; &lt;aura:attribute name="ParentType" type="String" default="" /&gt; &lt;b&gt;{!v.ParentType}({!v.recordId})&lt;/b&gt; &lt;br/&gt; &lt;lightning:recordEditForm recordId="{!v.recordId}"  objectApiName="Order"&gt;     &lt;lightning:messages /&gt;     &lt;lightning:inputField fieldName="Name" /&gt;     &lt;lightning:button class="slds-m-top_small" variant="brand" type="submit" name="update" label="Update" /&gt; &lt;/lightning:recordEditForm&gt;   It looks like below and even the Update-button works as expected and saves the record:    But what I really want is  &lt;lightning:recordEditForm recordId="{!v.recordId}"  objectApiName="{!v.ParentType}"&gt;   Note the {!v.ParentType} instead of the hardcoded "Order"  As an great unfortunate, this only collapses to that error-popup    In the screenshot you see, that the ParentType is correctly bound to v.ParentType (right above the button) which a I also verify in the console  Suspicion  I set the ParentType-attribute as a result of APEX call (asynchronously). This seems to be too late for the lightning:recordEditForm. It tries to render with objectApiName at a time where it is still blank, hence it crashes during initialization...  Question  Is there a clean way to avoid this and get something to fly with an dynamic objectApiName?  Trying to use $A.createComponents()  As @sfdcfox suggested I jump on the $A.createComponents() which turned indeed out to be tricky, exactly as sfdcfox has predicted. Im following this .  Added a button to the markup    Added a handler to the js-controller:  makeEdit : function(cmp, evt, hlp) {      console.log('ParentId :: ', cmp.get("v.ParentId") );      console.log('ParentType :: ', cmp.get("v.ParentType") );      $A.createComponents([             ["lightning:recordEditForm",{                 "recordId"          : cmp.get("v.ParentId"),                 "objectApiName"     : cmp.get("v.ParentType"),             }],             ["lightning:inputField",{                 "fieldName" : "Name"             }]         ]         ,function(components, status, errorMessage){             if (status === "SUCCESS") {                 var wrapper         = components[0];                 var inner           = components[1];                 wrapper.set("v.body", inner);             }             else if (status === "INCOMPLETE") {                 console.log("No response from server or client is offline.")                 // Show offline error             }             else if (status === "ERROR") {                 console.log("Error: " + errorMessage);                 // Show error message             }         }     ); },   Now I can press the button - but nothing - I repeat: n o t h i n g - gets rendered at all. What is my fault here? Note that the console.log get output and the attribute are holding good values. In Visual Studio, I can cycle through my clipboard history by pressing CTRL+SHIFT+V rather than CTRL+V. I believe it's called a clipboard ring. But that feature doesn't seem to exist outside of Visual Studio, at least not with the same key combination. Is there a key stroke combination built in to windows to do the same, i.e. be able to cycle through your clipboard history while pasting? I try to share my internet connection from my laptop (win7) via virtual wifi to my android phone (Samsung Gio). In an elevated cmd I enter  netsh wlan set hostednetwork mode=allow ssid=VWiFi key=xxx keyUsage=persistent netsh wlan start hostednetwork   The android phone connects to VWifi, but the internet connection is hardly usable on the phone while the internet connection on my laptop is very good at the same time (some Mbps)  What works: I can start WhatsApp, type and receive text messages, so I guess there's no general problem, i.e. config can't be completely wrong - but when I try to send pics or audio or try to receive pics or audio messages then I see from the network monitor on my laptop that the connection doesn't even try to send or receive anything (0 kbps up/down).  What sometimes works: connection to some websites with acceptable speed - but sometimes I don't get a single byte. Also this is not reproducible - the same website sometimes shows up, sometimes android tells my the site was not available.  What never worked so far: connecting to Google Play Store. It always tells me to check my connection and try again.  What I tried so far: I read on problems with IPv6, but no matter if I enable or disable IPv6 in the settings of the virtual Wifi, it doesn't help.  I also read about problems related to static/dynamic IPs, my netsh interface ip show config tells my that dchp isn't enabled on my virtual Wifi connection. If I try to enable it by netsh interface ip set address "myWificonnection" dhcp the android phone won't even connect anymore to the virtual Wifi at all. So there may be a solution here if android would connect with dhcp enabled.  I also read about problems with MAC filters, but this is no router, there's no MAC filter in the virtual Wifi.  When I directly connect to a real WLAN router, everything is fine and working. I have the problems only when trying to get into the internet via the virtual Wifi.  Any ideas what may be configured wrong? Either on laptop or on android? Thanks. grub issues message at boot - "error - can't find command hwmatch" This question  is exactly what I'm asking but was closed as non reproducible. Mine is very reproducible.  Ubuntu 18.04 freshly installed on a 64-bit UEFI machine. Default grub boot options work fine, but I wanted to add a brief countdown (my normal config).  After editing /etc/default/grub as normal and running sudo update-grub, the countdown works, but I get the error shown in the question title.  I tried the solution (copying files) in the closed question but it didn't seem to fit my configuration. Frankly I found the answer confusing.  I also tried editing /etc/grub.d/10_linux to comment out the IF-THEN structure that uses hwmatch. After that I did a sudo update-grub but I still got the error.  How can I get my countdown and not see this error?  Edit per comments -  Stock grub as installed (all non-commented-out lines shown)  GRUB_DEFAULT=0 GRUB_TIMEOUT_STYLE=hidden GRUB_TIMEOUT=0 GRUB_DISTRIBUTOR=`lsb_release -i -s 2&gt; /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX=""   Edited grub to give countdown (all non-commented-out lines shown)  GRUB_DEFAULT=0 GRUB_TIMEOUT_STYLE=countdown GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR=`lsb_release -i -s 2&gt; /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX="" Pointwise convergent and total variation Do computer viruses affect all user accounts on a computer? Do computer viruses affect all user accounts on a computer?  IF a virus affects a local user will that effect administrator account and vise-versa? Keen eye for detail (or details?) Which one is correct? "To have a keen eye for detail" or "To have a keen eye for details"? Can we simply rename an app if they are different versions and keep them both? For example, I have Xcode 4.4.1, and now Xcode 4.5 Golden Master (GM) version is available, but it is also called Xcode (when the .dmg is mounted as an disc image, it shows only one app (or folder), called Xcode)  I think the way is just to double click on the .dmg file, and then drag and drop that app into our Applications folder.  But since the current Xcode and Xcode 4.5GM have the same name, can the new one just be renamed and so we can have both versions on our machine?  I was worried that what if the app writes back data to the /Applications/Xcode folder, then the GM version can write unexpected data for the 4.4.1 version.  And will it work with other software, such as Xcode 3.2, Xcode 3.3, or even different versions of Microsoft Office and Adobe Photoshop?