~ 2 min
There is a shell, there is a way…
This is the study notes about bash shell-scripting. In part I, I would like to cover basic commands for starters.
I have a memory shortage condition and this is just to warm up my scripting skills. Don’t expect to explain things. If you have strong imagination,that might works.
Some Env Setup
create shortcut to save your fingers
$ set completion-ignore-case On
fuck the case-sensitive
this ‘#i’ is called shebang. Declares that you are start banging with bash.
like php,everything is with $ sign.
sometimes,you want variables from outside world.
Some more advanced reading
this is for smarty pant.
if you know how to count one two and three,you can do it!
Small bash program
This is a bash script that did something which makes sense.
calculate the length of the hypotenuse of a Pythagorean triangle
using hypotenuse^2 = adjacent^2 + opposite^2
####Globbing It’s a term comes from global and it will searchs all trees from the whole forest.
Not a big deal but minor issues are the thing that destory the most.