# - bof - #

#!/bin/bash



<<'comment'
rm -rf ~/KarlaS_Arch.sh; vim ~/KarlaS_Arch.sh;
copy & paste this content
chmod +x ~/KarlaS_Arch.sh; ~/./KarlaS_Arch.sh;

curl -O http://192.168.1.200/Programs/Linux.Img/Linux_Arch.Img/Arch_Install/KarlaS_Arch.Ins/KarlaS_Arch.sh;
chmod +x ~/KarlaS_Arch.sh; ~/./KarlaS_Arch.sh;

# -  - #
# - When this error happen on ssh command - #
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
# -  - #
# - Fixing this error - #
ssh-keygen -R "you server hostname or ip"
ssh-keygen -R 192.168.1.100;
ssh-keygen -R 192.168.1.200;
ssh-keygen -R 192.168.122.100;
ssh-keygen -R 192.168.122.200;

Documentation:
https://www.codegrepper.com/code-examples/shell/bash+goto+label

comment



# -  - #
# - sample_ - #
function sample_(){
  local pacmanF_=/etc/pacman.conf \
        sSed_='ParallelDownloads = 5' \
        candy_='ILoveCandy';
  local msg_0='Configuring '$pacmanF_' ...' \
        msg_1=$pacmanF_' already configured...' \
        sS1_='' sS2_='' sS3_='' sS4_='';
        
  echo '';

}



# BAT / CMD goto function
function goto
{
    label=$1
    cmd=$(sed -n "/^:[[:blank:]][[:blank:]]*${label}/{:a;n;p;ba};" $0 | 
          grep -v ':$')
    eval "$cmd"
    exit
}



# -  - #
# - gotoSample_ - #
function gotoSample_(){

  #apt update
  echo 'Hello...'
  
  # Just for the heck of it: how to create a variable where to jump to:
  #start=${1:-"start"}
  goto "$start"

: start
  goto_msg="Starting..."
  echo $goto_msg
  # Just jump to the label:
  goto "continue"

: skipped
  goto_msg="This is skipped!"
  echo $goto_msg

: continue
  goto_msg="Ended..."
  echo "$goto_msg"

  # following doesn't jump to apt update whereas original does
  goto update
}



gotoSample_




<<'comment'
ssh-keygen -R 192.168.122.100;
cd ~/Downloads; curl -O http://192.168.1.200/Programs/Linux.Img/Linux_Arch.Img/Arch_Install/KarlaS_Arch.Ins/bash_funcions_/goto_label.sh;
chmod +x ~/Downloads/goto_label.sh; ~/Downloads/./goto_label.sh;
comment



# - eof - #
