Print values in Array Bash Script My file Threadout.txt contains like Thread 1/1/25/100 val1=$(grep 'Thread' Threadout.txt | awk -F&quot;/&quot; '{print $1}')   val2=$(grep 'Thread' Threadout.txt | awk -F&quot;/&quot; '{print $2}')     val3=$(grep 'Thread' Threadout.txt | awk -F&quot;/&quot; '{print $3}')   val4=$(grep 'Thread' Threadout.txt | awk -F&quot;/&quot; '{print $4}')  for((i=1;i&lt;5;i++))   do     val[i]=$(grep 'Thread' Threadout.txt | awk -F&quot;/&quot; '{print $[i]}')     echo $val[i]  done  I have tried this array but not giving the correct result like 1 1 25 100 values. Any error?
How to print the position How to write the below lines using array?? val1=$(grep 'Thread' Threadout.txt | awk -F&quot;/&quot; '{print $1}')    val2=$(grep 'Thread' Threadout.txt | awk -F&quot;/&quot; '{print $2}')  val3=$(grep 'Thread' Threadout.txt | awk -F&quot;/&quot; '{print $3}')  val4=$(grep 'Thread' Threadout.txt | awk -F&quot;/&quot; '{print $4}')  Threadout.txt contains like &quot;Thread 1/1/25/100&quot;
How to randomly subset X% of selected points? What methods are available in ArcGIS 10.2 to randomly subset a selection of points.  For example, in the attached screenshot I am interested in keeping 20% of the selected points and deleting the rest. I understand what a decibel is, the spirit of the question is different: why do we still use decibels (and with at least two different, context-specific definitions), if we have the feat of scientific notation? I dare to claim that the change of 5e-1 (which is a half) is much more readable than 3dB (voltage? power?). 1e6 is more clear than 120dB, etc. Just for the joy of adding? 3dB + 7dB is 10dB, but 2e5+3e6 is errrm... I see many new datasheets from the top vendors (LTC, for example) use the V/V convention, which is closer to the scientific notation than to the decibels. An upcoming paradigm change? How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related: Services Actions Missing in Central Admin I know that I can update a snap package using  sudo snap refresh &lt;package&gt;   But is there a way to update all snaps, like   sudo apt dist-upgrade Does Exchange support disposable e-mail addresses? Sometimes it is useful to have e-mail address like foo-randomnumber@example.org, where randomnumber identifies the conversation between a robot such as a mailing list server and a user. Is this possible with Microsoft Exchange? Password protecting a page I'm trying to password protect a page but it doesn't seem to be working. I've set the password for the page but when you navigate to it it just loads up like normal and doesn't ask for any passwords.  This is the loop I have on my page:  &lt;?php /**  * @package WordPress  * @subpackage Default_Theme  * Template Name: Page  */  get_header(); ?&gt;  &lt;?php global $post; if ( post_password_required( $post ) ) { ?&gt;  &lt;?php $fields = get_acf(); ?&gt;  &lt;script type="text/javascript"&gt;  (function() {   window.onload = function() {   ...  }} )  &lt;/script&gt;  &lt;div id="map"&gt;&lt;/div&gt;  &lt;?php } else { ?&gt;     Not passworded        &lt;?php if (have_posts()) : ?&gt;         &lt;?php while (have_posts()) : the_post(); ?&gt;          &lt;?php endwhile; ?&gt;     &lt;?php endif; ?&gt;         &lt;?      } // Page isn't password-protected     ?&gt; &lt;?php get_footer(); ?&gt;   I want to password protect everything within the page.  UPDATE:  I have custom content on the page so if possible I need to be able to wrap some code around it all.  Update: What is the simplest and most robust way to get the user's current location on Android? Can we set privacy for "last seen" status? Track next Socratic badge progress Just got the  on StackOverflow and, since it can be awarded multiple times, wanted to start tracking progress to the next one, but, the badge is not shown in Available badges to track anymore:    Is it possible to track already awarded badges that can be awarded multiple times? Generate three correlated uniformly-distributed random variables Usually I don't mind about LaTeX's compilation speed, because a paper of less than 20 pages is compiled rather fast.  However, I am working on a large document - A report with more than 80 pages.  Compilation times are starting to slow me down.  I saw the couple of answers here on this topic, but most of my graphics are external and I don't use Tikz.  As a matter of fact, I'm not sure what's slowing the compilation down, other than the amount of text and required layout.   What's your best speeding-tex-up trick, other than externalizing graphics and pre-compiling the preamble? How can I know what's slowing TeX down? How to run Bash script on startup on Linux? I am running Linux 4.9.11-1.0.0 on my iMX7 dual development board. I have a test.sh file that I would like to run at startup. It currently only has a bunch of echo statements in it (just for testing purposes).   When I flick the switch on the board to turn it on, I see a bunch of initialization stuff come up. I would like the echo statements in my test.sh file to also be displayed in this initialization sequence on startup. Eventually once this is working, the plan is to do real stuff in place of the simple echo statements. I just want to make sure the script is running on startup at this point.  So far I have created the test.sh file and I am able to run it manually after the board has booted up. I have added the following to my /etc/rc.local file before the exit statement at the end:  sh '/home/root/test.sh'   I have verified that this rc.local file has #!/bin/sh -e at the top. I have also done:  $ chown root /etc/rc.local $ chmod 777 /etc/rc.local   Once this was all done, I verified that it should be working properly by typing:  $ /etc/init.d/rc.local start   Everything is working as expected up until this point and I am seeing the echo statements when I do that last step. However, when I go and try to reboot the board, I do not see the echo statements at all in the printed initialization stuff.  What am I missing? Maybe it is actually running on startup but I just don't see the output for some reason? Is there any difference between like best and like the best? Is there a difference between these two sentences? Are they the same?   What color do you like the best? What color do you like best?   Is there a difference in their meaning? Convert UTC/GMT time to local time In setting up dual Boot with Windows and Ubuntu, which OS do I install first? I'd like to install both Ubuntu 12.04 and Windows XP on a Dell laptop, and I was thinking about using a dual boot structure, and using the bulk of my hard drive as empty hard drive space to share files between the two operating systems (so choice of file system type is very important in this set-up).     The kind of partitioning structure I would like to use is  Partition 1 - Ubuntu 12.04 (root) (20GB)  Partition 2 - Ubuntu /home        (20GB)  Partition 3 : Free Space          (560GB)  Partition 4 : Windows XP          (35GB)  Partition 5 : SWAP                (3GB)  (Total Hardrive Capacity is ~640GB)    My question is; what is the best way to go about setting up this kind this system?   Should I install Windows XP first and setup the partitions, and then install Ubuntu which I believe will install the GRUB bootloader for OS booting choice   or   Do I install Ubuntu first, setting up the available partitions and then perform a WIndows install?  Please let me know if there is anything in this setup that I have left out and should know about, including things related to setting particular partitions as logical or primary, and whether the boot partition and the filesystem partition should actually be two separate partitions. Distribution of linear combination of OLS regression coefficients I have a simple linear OLS regression $Y_i = \alpha+ \beta_1 X_{1i} + \beta_2 X_{2i} + e_i$ where $e_i \sim N(0,\sigma)$. I have estimated the regression from the data and obtained estimates for my coefficients as well as the corresponding covariance matrix. Assume my dataset is large (>500)  Now I would like to construct the 95% confidence interval for $Z = a_1 \beta_1 + a_2 \beta_2$. My first thought was that I could assume that Z follows a normal distribution because my regression coefficients are approximately normal and a linear combination of normal variables is also a normal variable. I do find some sources where they treat $Z$ as a normal random variable.  But now I am in doubt because I found that a linear combination of normal random variables is only normal if they are independent. So is it still save to assume $Z$ is random? How is light affected by gravity? What's the difference between the server version and the desktop version? What is the fallacy that privileges one person over another? I see this a lot, someone in a category of people attempts to shut down anyone with an opinion that is not from the same category. For example, people without children weighing in on parenting; the parent may say something like "well, since you don't have kids and I do, my position is of more validity than yours."  Another example: a drug user (of some kind) telling someone who has never done drugs and does not care to, "until you tried it, you have no right to judge me."  People frequently try to limit the consideration on opinions to those in their same group, while it is perfectly reasonable that the non-drug user, especially if they are a chemist or well read on the subject, may have an equally valid opinion, or even more valid. In fact some might even say that someone NOT in the category has a better chance of being objective and seeing the forest for the trees.  So what is the fallacy of trying to shut down opinions when the source of the opinion is not someone who has personally had the experience under discussion?