echo "Using conditional statement to create a project directory and project"

# Variable section ekam
export project_dir=$HOME/vscode  # change vscode to different name to test git clone
export project=$project_dir/APCSA  # change APCSA to name of project from git clone
export project_repo="https://github.com/nighthawkcoders/APCSA.git"  # change to project of choice

cd ~    # start in home directory

# Conditional block to make a project directory
if [ ! -d $project_dir ]
then 
    echo "Directory $project_dir does not exists... makinng directory $project_dir"
    mkdir -p $project_dir
fi
echo "Directory $project_dir exists." 

# Conditional block to git clone a project from project_repo
if [ ! -d $project ]
then
    echo "Directory $project does not exists... cloning $project_repo"
    cd $project_dir
    git clone $project_repo
    cd ~
fi
echo "Directory $project exists."
evalmachine.<anonymous>:1
echo "Using conditional statement to create a project directory and project"
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

SyntaxError: Unexpected string
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at run ([eval]:1020:15)
    at onRunRequest ([eval]:864:18)
    at onMessage ([eval]:828:13)
    at process.emit (events.js:182:13)
    at emit (internal/child_process.js:812:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

lis (ls)

ls is used to list all the directories in the main directory. ls -a is used to list all the hidden files

echo "Navigate to project, then navigate to area wwhere files were cloned"
cd $project
pwd

echo ""
echo "list top level or root of files with project pulled from github"
ls

echo ""
echo "list again with hidden files pulled from github"
ls -a   # hidden files flag, many shell commands have flags

cd /home/ekamjotkaire/vscode/fast-pages/
echo ""
echo "list all files in long format"
ls -al   # all files and long listing
  Input In [11]
    echo "Navigate to project, then navigate to area wwhere files were cloned"
         ^
SyntaxError: invalid syntax

all the posts appear

ls -l does this function, as cd is set to the posts folder

echo "Look for posts"
export posts=$project/_posts  # _posts inside project
cd $posts  # this should exist per fastpages
pwd  # present working directory
cd /home/ekamjotkaire/vscode/fast-pages/_posts

ls -l  # list posts
  Input In [9]
    echo "Look for posts"
         ^
SyntaxError: invalid syntax

All the notebook files appear

ls -l does this function, as cd is set to the notebooks folder

echo "Look for notebooks"
export notebooks=$project/_notebooks  # _notebooks is inside project
cd $notebooks   # this should exist per fastpages
pwd  # present working directory

cd /home/ekamjotkaire/vscode/fast-pages/_notebooks
ls -l  # list notebooks
Look for notebooks
bash: cd: /_notebooks: No such file or directory
/home/ekamjotkaire/vscode/fast-pages/_notebooks
bash: cd: /home/ekamjotkaire/vscode/fast-pages/_notebooks: No such file or directory
total 3144
-rw-r--r-- 1 ekamjotkaire ekamjotkaire 3162470 Aug 21 19:36 2020-02-20-test.ipynb
-rw-r--r-- 1 ekamjotkaire ekamjotkaire     888 Aug 24 10:16 2022-08-20-java.ipynb
-rw-r--r-- 1 ekamjotkaire ekamjotkaire     941 Aug 23 22:26 2022-08-20-python.ipynb
-rw-r--r-- 1 ekamjotkaire ekamjotkaire    4288 Aug 25 22:57 2022-08-24-score_calculator.ipynb
-rw-r--r-- 1 ekamjotkaire ekamjotkaire   23435 Aug 25 23:18 2022-08-25-bash_kernel.ipynb
-rw-r--r-- 1 ekamjotkaire ekamjotkaire     771 Aug 21 19:36 README.md
drwxr-xr-x 2 ekamjotkaire ekamjotkaire    4096 Aug 21 19:36 ghtop_images
drwxr-xr-x 2 ekamjotkaire ekamjotkaire    4096 Aug 21 19:36 my_icons

This returns the contents in the read me file

echo "Navigate to project, then navigate to area wwhere files were cloned"

cd $project
echo "show the contents of README.md"
echo ""

cat README.md  # show contents of file, in this case markdown
cd /home/ekamjotkaire/vscode/fast-pages/README.md

echo ""
echo "end of README.md"
Navigate to project, then navigate to area wwhere files were cloned
show the contents of README.md

cat: README.md: No such file or directory
bash: cd: /home/ekamjotkaire/vscode/fast-pages/README.md: No such file or directory

end of README.md

env

env command is for the enviroment. It returns all the environments that have been set up. We can check whether all the required environments have been set.

echo "Show the shell environment variables, key on left of equal value on right"
echo ""

env
Show the shell environment variables, key on left of equal value on right

SHELL=/bin/bash
PYTHONUNBUFFERED=1
project=/home/ekamjotkaire/vscode/APCSA
CONDA_EXE=/home/ekamjotkaire/anaconda3/bin/conda
_CE_M=
WSL_DISTRO_NAME=Ubuntu
ELECTRON_RUN_AS_NODE=1
VSCODE_AMD_ENTRYPOINT=vs/workbench/api/node/extensionHostProcess
NAME=Code
PWD=/home/ekamjotkaire/vscode/APCSA
LOGNAME=ekam
CONDA_PREFIX=/home/ekamjotkaire/anaconda3
MOTD_SHOWN=update-motd
project_dir=/home/ekamjotkaire/vscode
HOME=/home/ekamjotkaire
LANG=C.UTF-8
WSL_INTEROP=/run/WSL/8_interop
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
WAYLAND_DISPLAY=wayland-0
CONDA_PROMPT_MODIFIER=(base) 
PYDEVD_USE_FRAME_EVAL=NO
posts=/home/ekamjotkaire/vscode/APCSA/_posts
LESSCLOSE=/usr/bin/lesspipe %s %s
VSCODE_HANDLES_SIGPIPE=true
TERM=xterm-256color
_CE_CONDA=
LESSOPEN=| /usr/bin/lesspipe %s
USER=divya
PYTHONIOENCODING=utf-8
notebooks=/home/divya/vscode/APCSA/_notebooks
CONDA_SHLVL=1
DISPLAY=:0
SHLVL=2
PAGER=cat
project_repo=https://github.com/nighthawkcoders/APCSA.git
VSCODE_CWD=/mnt/c/ekamjotkaire
CONDA_PYTHON_EXE=/home/ekamjotkaire/anaconda3/bin/python
XDG_RUNTIME_DIR=/mnt/wslg/runtime-dir
PS1=[PEXP\[\]ECT_PROMPT>
CONDA_DEFAULT_ENV=base
WSLENV=ELECTRON_RUN_AS_NODE/w:
VSCODE_WSL_EXT_LOCATION=/mnt/c/Users/prash/.vscode/extensions/ms-vscode-remote.remote-wsl-0.66.3
XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
PATH=/home/ekamjotkaire/.vscode-server/bin/e4503b30fc78200f846c62cf8091b76ff5547662/bin/remote-cli:/home/ekamjotkaire/.local/bin:/home/ekamjotkaire/anaconda3/bin:/home/divya/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0:/mnt/c/WINDOWS/System32/OpenSSH:/mnt/c/Users/prash/AppData/Local/Microsoft/WindowsApps:/mnt/c/Aadya/bin:/snap/bin
VSCODE_NLS_CONFIG={"locale":"en","availableLanguages":{}}
HOSTTYPE=x86_64
PULSE_SERVER=/mnt/wslg/PulseServer
VSCODE_HANDLES_UNCAUGHT_ERRORS=true
OLDPWD=/home/ekamjotkaire/vscode/APCSA/_notebooks
VSCODE_IPC_HOOK_CLI=/mnt/wslg/runtime-dir/vscode-ipc-d123d553-5453-4217-b8bb-4bfec6326687.sock
_=/usr/bin/env
cd $project

echo ""
echo "show the secrets of .git"
cd .git
ls -l

echo ""
echo "look at config file"
cat config
show the secrets of .git
total 60
-rw-r--r-- 1 ekamjotkaire ekamjotkaire    23 Aug 25 23:11 HEAD
drwxr-xr-x 2 ekamjotkaire ekamjotkaire  4096 Aug 25 23:11 branches
-rw-r--r-- 1 ekamjotkaire ekamjotkaire   269 Aug 25 23:11 config
-rw-r--r-- 1 ekamjotkaire ekamjotkaire    73 Aug 25 23:11 description
drwxr-xr-x 2 ekamjotkaire ekamjotkaire  4096 Aug 25 23:11 hooks
-rw-r--r-- 1 ekamjotkaire ekamjotkaire 20422 Aug 25 23:11 index
drwxr-xr-x 2 ekamjotkaire ekamjotkaire  4096 Aug 25 23:11 info
drwxr-xr-x 3 ekamjotkaire ekamjotkaire  4096 Aug 25 23:11 logs
drwxr-xr-x 4 ekamjotkaire ekamjotkaire  4096 Aug 25 23:11 objects
-rw-r--r-- 1 ekamjotkaire ekamjotkaire   271 Aug 25 23:11 packed-refs
drwxr-xr-x 5 ekamjotkaire ekamjotkaire  4096 Aug 25 23:11 refs

look at config file
[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
[remote "origin"]
	url = https://github.com/nighthawkcoders/APCSA.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master