关注

shell中的小trick


(1) define functions in shell
1) open a <file>, write your function
2) source <file>
3) then you can use your function in shell

(2) special variable
`$?`: the error code of your previous shell command
`$_`: the last argv of your previous command

(3) small trick
`!!`: shell will replace your !! to be your previous command

(4) difference between double and single quote
variables in double quote can be replaced by its value, while in single quote cannot.

登录以加入对话
雾海

雾海是一个开放且不限制讨论主题的非营利性中文社区,名字来源于德国浪漫主义画家 Friedrich 的画作《雾海上的旅人》。生活总是在雾海中吞吐不定,不管怎么艰辛,他还是站在了这里!希望大家在这里玩的开心~