June 2018
Intermediate to advanced
330 pages
9h 47m
English
First, we specify the location of Spark's source code. The _spark_archive contains the name of the archive; we use awk to extract the last element (here, it is specified by the $NF flag) from the _spark_source. The _spark_dir contains the name of the directory our archive will unpack into; in our current case, this will be spark-2.3.1. Finally, we specify our destination folder where we will be going to move the binaries to: it will either be /opt/spark (default) or your home directory if you use the -ns (or --nosudo) switch when calling the ./installFromSource.sh script.
Next, we check the OS name we are using:
function checkOS(){ _uname_out="$(uname -s)" case "$_uname_out" in Linux*) _machine="Linux";; Darwin*) _machine="Mac";; ...