echo "Using conditional statement to create a project directory and project"
 
# Variable section
export project_dir=$HOME/vscode  # change vscode to different name to test git clone
export project=$project_dir/APCSP  # change APCSP to name of project from git clone
export project_repo="https://github.com/nighthawkcoders/APCSP.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."
Using conditional statement to create a project directory and project
Directory /Users/dmsol/vscode exists.
Directory /Users/dmsol/vscode/APCSP exists.
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
 
echo ""
echo "list all files in long format"
ls -al   # all files and long listing
Navigate to project, then navigate to area wwhere files were cloned
/Users/dmsol/vscode/APCSP

list top level or root of files with project pulled from github
Gemfile			_includes		_word
LICENSE			_layouts		assets
Makefile		_notebooks		docker-compose.yml
README.md		_pages			images
_action_files		_plugins		index.html
_config.yml		_posts			python
_fastpages_docs		_sass

list again with hidden files pulled from github
.			Makefile		_posts
..			README.md		_sass
.devcontainer.json	_action_files		_word
.git			_config.yml		assets
.gitattributes		_fastpages_docs		docker-compose.yml
.github			_includes		images
.gitignore		_layouts		index.html
.vscode			_notebooks		python
Gemfile			_pages
LICENSE			_plugins

list all files in long format
total 96
drwxr-xr-x  28 dmsol  staff    896 Aug 21 22:08 .
drwxr-xr-x   4 dmsol  staff    128 Aug 24 11:54 ..
-rw-r--r--   1 dmsol  staff    420 Aug 21 22:08 .devcontainer.json
drwxr-xr-x  14 dmsol  staff    448 Aug 25 15:18 .git
-rw-r--r--   1 dmsol  staff     84 Aug 21 22:08 .gitattributes
drwxr-xr-x   4 dmsol  staff    128 Aug 21 22:08 .github
-rw-r--r--   1 dmsol  staff    917 Aug 21 22:08 .gitignore
drwxr-xr-x   3 dmsol  staff     96 Aug 21 22:08 .vscode
-rwxr-xr-x   1 dmsol  staff   1304 Aug 21 22:08 Gemfile
-rw-r--r--   1 dmsol  staff  11351 Aug 21 22:08 LICENSE
-rwxr-xr-x   1 dmsol  staff   1422 Aug 21 22:08 Makefile
-rwxr-xr-x   1 dmsol  staff   3614 Aug 21 22:08 README.md
drwxr-xr-x  18 dmsol  staff    576 Aug 21 22:08 _action_files
-rw-r--r--   1 dmsol  staff   3716 Aug 21 22:08 _config.yml
drwxr-xr-x  24 dmsol  staff    768 Aug 21 22:08 _fastpages_docs
drwxr-xr-x  29 dmsol  staff    928 Aug 21 22:08 _includes
drwxr-xr-x   6 dmsol  staff    192 Aug 21 22:08 _layouts
drwxr-xr-x  12 dmsol  staff    384 Aug 25 15:18 _notebooks
drwxr-xr-x   9 dmsol  staff    288 Aug 25 15:18 _pages
drwxr-xr-x   4 dmsol  staff    128 Aug 21 22:08 _plugins
drwxr-xr-x  29 dmsol  staff    928 Aug 25 15:18 _posts
drwxr-xr-x   3 dmsol  staff     96 Aug 21 22:08 _sass
drwxr-xr-x   3 dmsol  staff     96 Aug 21 22:08 _word
drwxr-xr-x   4 dmsol  staff    128 Aug 21 22:08 assets
-rwxr-xr-x   1 dmsol  staff   1136 Aug 21 22:08 docker-compose.yml
drwxr-xr-x  52 dmsol  staff   1664 Aug 21 22:08 images
-rw-r--r--   1 dmsol  staff   1061 Aug 21 22:08 index.html
drwxr-xr-x   3 dmsol  staff     96 Aug 21 22:08 python
# You must run cells above to define variable and project
 
echo "Look for posts"
export posts=$project/_posts  # _posts inside project
cd $posts  # this should exist per fastpages
pwd  # present working directory
ls -l  # list posts
Look for posts
/Users/dmsol/vscode/APCSP/_posts
total 456
-rw-r--r--  1 dmsol  staff  21306 Aug 21 22:08 2022-06-01-TT160-deploy.md
-rw-r--r--  1 dmsol  staff   5861 Aug 21 22:08 2022-07-07-PBL-binary.md
-rw-r--r--  1 dmsol  staff   3085 Aug 21 22:08 2022-07-08-PBL-grade_calc.md
-rw-r--r--  1 dmsol  staff   3698 Aug 21 22:08 2022-07-08-PBL-graph.md
-rw-r--r--  1 dmsol  staff   5729 Aug 21 22:08 2022-07-08-PBL-life.md
-rw-r--r--  1 dmsol  staff  14387 Aug 21 22:08 2022-07-08-PBL-snake.md
-rw-r--r--  1 dmsol  staff    334 Aug 21 22:08 2022-07-10-PBL-database.md
-rw-r--r--  1 dmsol  staff   2908 Aug 21 22:08 2022-07-10-PBL-jokes.md
-rw-r--r--  1 dmsol  staff   4046 Aug 21 22:08 2022-07-10-PBL-rapidapi.md
-rw-r--r--  1 dmsol  staff   6685 Aug 21 22:08 2022-07-19-PBL-calculator.md
-rw-r--r--  1 dmsol  staff  23325 Aug 21 22:08 2022-07-25-CSP-workshop.md
-rw-r--r--  1 dmsol  staff   2333 Aug 21 22:08 2022-08-15-TP000-student_score_history.md
-rw-r--r--  1 dmsol  staff   4363 Aug 21 22:08 2022-08-15-TP100-pseudo_code.md
-rw-r--r--  1 dmsol  staff   7968 Aug 21 22:08 2022-08-15-TR100-tool_setup.md
-rw-r--r--  1 dmsol  staff  15026 Aug 21 22:08 2022-08-15-TT100-tools.md
-rw-r--r--  1 dmsol  staff   5590 Aug 21 22:08 2022-08-15-TT101-vscode-wsl.md
-rw-r--r--  1 dmsol  staff   2155 Aug 25 15:18 2022-08-22-TR110-intro_python.md
-rw-r--r--  1 dmsol  staff   5173 Aug 21 22:08 2022-08-22-TT110-fastpages.md
-rw-r--r--  1 dmsol  staff   2798 Aug 25 15:18 2022-08-22-TT110-focus.md
-rw-r--r--  1 dmsol  staff   2737 Aug 21 22:08 2022-08-29-TR120-data_abstract.md
-rw-r--r--  1 dmsol  staff  10683 Aug 21 22:08 2022-08-29-TT120-agile.md
-rw-r--r--  1 dmsol  staff   4498 Aug 21 22:08 2022-08-29-TT120-html_fragments.md
-rw-r--r--  1 dmsol  staff   9037 Aug 21 22:08 2022-09-05-TP130-create_performance_task.md
-rw-r--r--  1 dmsol  staff   7753 Aug 21 22:08 2022-09-05-TP131-create-task-bria.md
-rw-r--r--  1 dmsol  staff   8066 Aug 21 22:08 2022-09-05-TR130-creative_development.md
-rw-r--r--  1 dmsol  staff   3520 Aug 21 22:08 2022-09-05-TT130-applab.md
-rw-r--r--  1 dmsol  staff    720 Aug 21 22:08 README.md
echo "Look for notebooks"
export notebooks=$project/_notebooks  # _notebooks is inside project
cd $notebooks   # this should exist per fastpages
pwd  # present working directory
ls -l  # list notebooks
Look for notebooks
/Users/dmsol/vscode/APCSP/_notebooks
total 280
-rw-r--r--  1 dmsol  staff  14243 Aug 21 22:08 2022-06-01-TT150-webapi_tutorial.ipynb
-rw-r--r--  1 dmsol  staff   8653 Aug 21 22:08 2022-07-21-PBL-neo4j_intro.ipynb
-rw-r--r--  1 dmsol  staff  11694 Aug 25 15:18 2022-08-22-TP110-python_hello.ipynb
-rw-r--r--  1 dmsol  staff  20003 Aug 25 15:18 2022-08-22-TT110-anthony_and_sahil.ipynb
-rw-r--r--  1 dmsol  staff   9797 Aug 25 15:23 2022-08-22-TT110-bash_tutorial.ipynb
-rw-r--r--  1 dmsol  staff  35721 Aug 25 15:18 2022-08-25-tool_check.ipynb
-rw-r--r--  1 dmsol  staff  10141 Aug 21 22:08 2022-08-29-TP120-python_lists.ipynb
-rw-r--r--  1 dmsol  staff  12632 Aug 21 22:08 2022-09-05-TT130-js_tutorial.ipynb
-rw-r--r--  1 dmsol  staff    771 Aug 21 22:08 README.md
drwxr-xr-x  3 dmsol  staff     96 Aug 21 22:08 images
echo "Look for images in notebooks, print working directory, list files"
cd $notebooks/images  # this should exist per fastpages
pwd
ls -l
Look for images in notebooks, print working directory, list files
/Users/dmsol/vscode/APCSP/_notebooks/images
total 200
-rw-r--r--  1 dmsol  staff  101617 Aug 21 22:08 kernels.png
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
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

end of README.md
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
TMPDIR=/var/folders/m3/xnfxr90d6696g4yv0yfqy1_40000gn/T/
CONDA_SHLVL=1
PYTHONUNBUFFERED=1
CONDA_PROMPT_MODIFIER=(base) 
OLDPWD=/Users/dmsol/vscode/APCSP/_notebooks
ORIGINAL_XDG_CURRENT_DESKTOP=undefined
MallocNanoZone=0
PYTHONIOENCODING=utf-8
USER=dmsol
CONDA_EXE=/opt/anaconda3/bin/conda
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.Ub6XgHKNQG/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
PAGER=cat
VSCODE_AMD_ENTRYPOINT=vs/workbench/api/node/extensionHostProcess
ELECTRON_RUN_AS_NODE=1
_CE_CONDA=
PATH=/opt/anaconda3/bin:/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
CONDA_PREFIX=/opt/anaconda3
PWD=/Users/dmsol/vscode/APCSP/_notebooks/images
notebooks=/Users/dmsol/vscode/APCSP/_notebooks
VSCODE_HANDLES_UNCAUGHT_ERRORS=true
project_repo=https://github.com/nighthawkcoders/APCSP.git
project=/Users/dmsol/vscode/APCSP
project_dir=/Users/dmsol/vscode
XPC_FLAGS=0x0
PS1=[PEXP\[\]ECT_PROMPT>
_CE_M=
XPC_SERVICE_NAME=0
SHLVL=2
HOME=/Users/dmsol
APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL=1
VSCODE_NLS_CONFIG={"locale":"en-us","availableLanguages":{},"_languagePackSupport":true}
CONDA_PYTHON_EXE=/opt/anaconda3/bin/python
LOGNAME=dmsol
VSCODE_IPC_HOOK=/Users/dmsol/Library/Application Support/Code/1.70.2-main.sock
VSCODE_CODE_CACHE_PATH=/Users/dmsol/Library/Application Support/Code/CachedData/e4503b30fc78200f846c62cf8091b76ff5547662
CONDA_DEFAULT_ENV=base
VSCODE_PID=27686
posts=/Users/dmsol/vscode/APCSP/_posts
VSCODE_CWD=/
_=/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 88
-rw-r--r--   1 dmsol  staff    102 Aug 25 15:18 FETCH_HEAD
-rw-r--r--   1 dmsol  staff     23 Aug 21 22:08 HEAD
-rw-r--r--   1 dmsol  staff     41 Aug 25 15:18 ORIG_HEAD
-rw-r--r--   1 dmsol  staff    314 Aug 21 22:08 config
-rw-r--r--   1 dmsol  staff     73 Aug 21 22:08 description
drwxr-xr-x  15 dmsol  staff    480 Aug 21 22:08 hooks
-rw-r--r--   1 dmsol  staff  20021 Aug 25 15:18 index
drwxr-xr-x   3 dmsol  staff     96 Aug 21 22:08 info
drwxr-xr-x   4 dmsol  staff    128 Aug 21 22:08 logs
drwxr-xr-x  44 dmsol  staff   1408 Aug 25 15:18 objects
-rw-r--r--   1 dmsol  staff    271 Aug 21 22:08 packed-refs
drwxr-xr-x   5 dmsol  staff    160 Aug 21 22:08 refs

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