Assigning value to array at certain index Hi am trying to write a script that updates a row read from file , Every thing is working fine so far except the following mentioned  line at the end  here is my script :  #!/bin/bash       #INITIALIZE PATHS DB_PATH=${1}       DATA_PATH="$DB_PATH/data/" METADATA_PATH="$DB_PATH/metadata"     #LOAD THE META DB FILE AND READ DATABASE NAME IN DB_NAME  #READ ALSO COLUMNS IN AN ARRAY CALLED TABLE_NAMES                       METADATA_LOAD=$(&lt;"$METADATA_PATH/DB") IFS=$'+' read -a NAMES &lt;&lt;&lt; "$METADATA_LOAD"    #PROMPET FOR TABLE TO UPDATE echo "" echo "" echo "" echo "You Currently Working with Database ${NAMES[0]}"  echo "" echo "You Have The Following Tables to Choose From :" IFS=' ' for token in ${NAMES[@]:1} do echo "  $token" done echo "" echo "" echo "" echo "Please Write The Name Of The Table You Want To Update :" read CURRENT_TABLE   #Form META DATA TABLE FILE PATH TABLE_DATA_PATH="$DB_PATH/data/$CURRENT_TABLE" TABLE_METADATA_PATH="$DB_PATH/metadata/$CURRENT_TABLE"   #PROMPET WHICH COLUMN IS NEEDED TO CHECK FOR EQUALITY echo "" echo "" echo "" echo "The Table You Selected Have The Following Columns" i=0  TABLE_METADATA=$(&lt;"$TABLE_METADATA_PATH") IFS='+' read -a CURRENT_TABLE_META &lt;&lt;&lt; "$TABLE_METADATA" IFS=' ' for token in ${CURRENT_TABLE_META[@]:1} do i=$(($i+1)) echo $i $token done echo "Please Enter The Number Column to Check For Equality" read TEST_COLUMN_NUM echo "" echo "" echo "Please Enter The Column Value to Check For Equality" read TEST_COLUMN_VAL  echo "Please Enter The Column Number to Modify" read MODIFY_COLUMN_NUM  echo "Please Enter The New Column Value" read MODIFY_COLUMN_VAL  #Form DATA TABLE FILE PATH TABLE_DATA=$(&lt;"$TABLE_DATA_PATH")    IFS=' ' read -a ROWS_ARRAY &lt;&lt;&lt; "$TABLE_DATA"       for CURRENT_ROW_INDEX in ${!ROWS_ARRAY[@]} do    IFS=':'   read -a COLUMNS_ARRAY &lt;&lt;&lt; "${ROWS_ARRAY[CURRENT_ROW_INDEX]}"     for CURRENT_COL_INDEX in ${!COLUMNS_ARRAY[@]}     do         if [[ ${COLUMNS_ARRAY[$CURRENT_COL_INDEX]} == $TEST_COLUMN_VAL  &amp;&amp;  $CURRENT_COL_INDEX -eq $(($TEST_COLUMN_NUM-1)) ]]        then             IFS=' '            COLUMNS_ARRAY[$MODIFY_COLUMN_NUM] = "ABC"           fi        done done   I did not finish the script yet but I have an error at the line :   COLUMNS_ARRAY[$MODIFY_COLUMN_NUM] = "ABC"   it gives me Error     ./Update: line 91: COLUMNS_ARRAY[3]: command not found   I want to assign to the array at the given index replacing the old value, please help me to know the reason of error and how to solve it
Spaces in variable assignments in shell scripts What is the difference between below variables assignments?   var=23 var =23 var= 23 var = 23   Is there any difference in space around the assignment operator?
Input 0  echo foo | xargs -L 1 -I '{}' echo '{}'   Output 0  foo   Input 1  echo foo | xargs -I '{}' -L 1 echo '{}'   Output 1  {} foo   Why changing the order of options of xargs changes the output?  Version: xargs (GNU findutils) 4.6.0 Upload files with HTTPWebrequest (multipart/form-data) What is the number of automorphisms (including identity) for permutation group $S_3$ on 3 letters? Why do the Localization of a Ring This question may be a bit vague, but neverthless, i would like to see an answer. Wikipedia tells me that:   In abstract algebra, localization is a systematic method of adding multiplicative inverses to a ring.   It is clear that for integral domains, we have the Field of Fractions, and we work on it. It's obvious that a Field has multiplicative inverses. Now if we consider any arbitrary ring $R$, by the definition of localization, it means that we are adding multiplicative inverses to $R$ thereby wanting $R$ to be a division ring or a field. My question, why is it so important to look at this concept of Localization. Or how would the theory look like if we never had the concept of Localization. I was told that computers with more than 2 gig's memory need a 64 bit operating system to utilize all RAM.  Is the 64bit Ubuntu download really JUST for AMD processors? I am asking because the disk image I downloaded says AMD64.  So will my new Intel 2.3Ghz Core i3 Dual Core processor work with 64 bit Ubuntu?  It runs the 64bit version of Windows without any qualm. How to efficiently partition a single Windows-Ubuntu dual boot disk? This is not a question on  or  but is a question on access rights and how not to let them bite you in the lower abdomen...  ;-) This question will not help you how to make partitions on your disk, but will tell you what to do in , depending on your personal use case, so choose one of the following:      Note: The above questions can also be used with multiple disks, but the examples in the answers are given for one disk. How can I quickly know the rank of this / any other matrix? What is the relationship between the focal length and field of view for an equal-area ("equisolid") projection fisheye lens?  Alternatively, what is the relationship between the 180-degree image circle size and the focal length for such a lens?  Ultimately I want to find the field of view of a Tokina 10-17 mm fisheye zoom at focal lengths other than 10 mm on APS-C (). Duplicate questions without answers I am seeking suggestions on what may be going in with an iMac I am currently troubleshooting, as it’s displaying behaviour I do not recall seeing before.  Short story  This iMac refuses to boot up. It gets the Apple logo, gets past the progress bar, and then gets stuck on the grey screen for about two minutes before rebooting itself. However, what makes this odd is that I can:   Start the iMac in Target Disk Mode and use it to successfully boot up other Macs. In doing so everything seems to work perfectly fine. Successfully boot the iMac from an external drive and everything seems to work perfectly fine.   Long story  I was presented this iMac about 2 weeks ago as it refused to bootup. That is, it would commence booting up and cycle through the Apple logo and progress bar, but after the progress bar completed it would remain on the grey screen for a couple of minutes before rebooting itself and doing the same thing all over again.   To address this I undertook the following troubleshooting steps:   Resetting SMC - failed Resetting NVRAM - failed Starting up in Safe Mode - failed Starting up in OS X Recovery Mode – failed Starting up in OS X Recovery Mode via the internet – failed Undertook an extensive hardware test using Apple Hardware Test (AHT 3A213) - passed Started iMac in Target Disk Mode and retested hard drive using Scannerz on another iMac - passed Started iMac in Target Disk Mode and reformatted the hard drive and did a clean install of Mac OS X El Capitan 10.11.6 - successful Migrated data from a Time Machine backup - successful   After these steps I tested the iMac for four days with no issues in terms of booting up and using the computer. On the fifth day I needed to manually import seven Apple Mail mailboxes. I did these one by one and six of them imported within minutes.  The last mailbox was showing as being 270 GB in size. I knew this was inaccurate, but I decided to import the mailbox so I could do a mailbox rebuild to correct whatever corruption had taken place. This import took over 12hrs to do but seemed to work fine and Mail was displaying the emails.  I then tested the iMac on and off for another day to ensure it had no problems booting up. This was successful.  I then decided to initiate the mailbox rebuild, but as soon as I did the screen went black and stayed that way regardless of any keyboard shortcuts I tried using. I waited an hour, forced a reboot, and ever since the iMac has returned to its original behaviour of not booting up – it would get past the progress bar and stay on the grey screen for a while before rebooting itself and starting the whole vicious cycle again.  I have again retested the hard drive, processor, RAM and Video Ram by starting the iMac from an external hard drive and using a combination of the following packages:   Apple Hardware Test (AHT 3A213) Scannerz TechTool Pro Memtester (under the Homebrew subsystem)   And now I have a situation where I can boot the iMac from external hard drives, and also use it in target disk mode to boot up other Macs, but cannot use it to boot from its own internal drive.  At present I have isolated the internal hard drive and am running a scan to check for any malware.   In the meantime, I am wondering:   Has anyone come across a similar scenario and, if so, what was the cause? Assuming I find no malware, do I go through the reformat/clean install/migration process again, but this time not import the last mailbox and see whether the iMac works fine? Any other suggestions?   iMac specs are as follows:   iMac (27”, mid 2011) 3.1 GHz Intel Core i5 8 GB RAM AMD Radeon HD 6970M 1024 MB 1 TB 3.5” SATA HD Mac OS X El Capitan 10.11.6 Why don't planets have Circular orbits? What is the procedure to become a Cricket Umpire? In cricket how does someone become an umpire at international level? Is there some procedure for this? How are they selected and what is the criteria for this? I have read lots of information about page caching and partial page caching in a MVC application. However, I would like to know how you would cache data.  In my scenario I will be using LINQ to Entities (entity framework). On the first call to GetNames (or whatever the method is) I want to grab the data from the database. I want to save the results in cache and on the second call to use the cached version if it exists.  Can anyone show an example of how this would work, where this should be implemented (model?) and if it would work.  I have seen this done in traditional ASP.NET apps , typically for very static data. Automatically prefer Ethernet over WLAN In the following sentence, I want to know if I've understand the correct meaning or not:     This version holds that the wave function does not so much describe the state of the physical system as the state of our knowledge of the system.    Can we say that it means the wave function describes the state of our knowledge  of the system more than it describes the state of the physical system  ?  It is worth noting that in the Cambridge Dictionary, we read:  not so much sth as sth ​ If you say that something is not so much one thing as something else, you mean it is more the second thing: They're not so much lovers as friends. I don't feel angry so much as sad. Deprecated: Function split() is deprecated. How to rewrite this statement? What was Stack Exchange 1.0? I've seen a few users mention that certain SE sites like  and  are unique, as they were originally created as Stack Exchange 1.0 sites.  As a fairly recent user, I don't know what Stack Exchange 1.0 was like. The current version of Stack Exchange is the only version I've ever known.   What was Stack Exchange 1.0? What changed between SE 1.0 and 2.0? How can I install Ubuntu on a headless machine? I have a headless storage server with preconfigured Windows Home Server. How can I install Ubuntu without a display?  Do I have to build a custom install flash drive? If so, what would be the basic procedure? Is there a program (like unetbootin) to do this? What is the difference between weight and mass? What is the difference between the weight of an object and the mass of an object? Does $\sum_{n=1}^\infty \frac{\cos{(\sqrt{n})}}{n}$ converge?