In the process of learning Linux, have encountered some small problems, although may be insignificant, but in the pursuit of details often will be more tangled (obsessive-compulsive disorder), empty a blog post space, record some details on the content, are very small very simple things, do not like to spray.
01, BC Calculation floating point problem
When using BC to calculate the number, if the result appears a decimal point, then the content of the decimal point is not displayed by default, then did not care too much.
[Email protected] wangdong]# echo "1500/1024" | Bc1[[email protected] wangdong]# [[email protected] wangdong]# echo "scale=4;1500/1024" | Bc1.4648[[email protected] wangdong]#
02. The IF condition statement determines that the string contains
If the regular usage of if is used, except that the match is not a regular expression, it just matches the string.
[[email protected] wangdong]# cat test.sh #!/bin/basha= "ABCDEFG" if [[$A =~ ']];then echo ' suc ' fi[[email protected] W angdong]# [[email protected] wangdong]# sh test.sh bcdsuc[[email protected] wangdong]# sh test.sh h[[email protected] Wang dong]# sh test.sh gsuc[[email protected] wangdong]#
This article is from "rookie East" blog, please be sure to keep this source http://radish.blog.51cto.com/5944322/1729893
Shell Operation details finishing (not completed)