A simple shell script for using on reviews at @42Tokyo's Go Piscine.
Go-Piscine
|-- check.sh <---- here
|-- Go[XX]
|-- ex[XX]
|-- main.go
|-- vendor
|-- ft
|-- printrune.go
|-- piscine
|-- [excercisename].go
First, give the permissions to execute the file:
chmod u+x check.sh
Source the file to be able to cd
into other directories:
source check.sh
You should execute the command like this:
sh check.sh ACTION (e.g. see/edit/run) LESSON (e.g. Go00) EXERCISE (e.g. ex00)
Use sh check.sh see 00 01
(to see Go00's ex01 contents using cat/bat)
Use sh check.sh edit 00 01
(to edit Go00's ex01 using vim)
Use sh check.sh run 00 01
(to run Go00's ex01)
💡 There is no need of running go mod init exXX because this command already does it automatically for you!