linux:bashshell
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:bashshell [2016/01/15 04:47] – [array] admin | linux:bashshell [2022/10/29 16:15] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 163: | Line 163: | ||
| ==== Bitwise operators ==== | ==== Bitwise operators ==== | ||
| ==== comparision operators ==== | ==== comparision operators ==== | ||
| - | === integer | + | === Integer |
| -eq : is equal to<code bash> | -eq : is equal to<code bash> | ||
| if [ " | if [ " | ||
| Line 315: | Line 315: | ||
| </ | </ | ||
| ==== Find files that contain the text ==== | ==== Find files that contain the text ==== | ||
| + | * Simple< | ||
| + | grep -rnw . -e "Begin Facebook Code" | ||
| + | </ | ||
| + | * Custom find with regular expression< | ||
| + | grep -rnw . -e ' | ||
| + | </ | ||
| + | ==== Find files that file name length > 29 ==== | ||
| + | <code bash> | ||
| + | for i in `ls -1`;do sub_i=(`echo $i|cut -d' | ||
| + | </ | ||
| + | ==== Manipulating String ==== | ||
| + | refer: http:// | ||
| + | * String length: **${# | ||
| + | str=" | ||
| + | </ | ||
| + | 12 | ||
| + | </ | ||
| + | * Replace String:< | ||
| + | str=" | ||
| + | </ | ||
| + | Second String | ||
| + | </ | ||
| + | ==== update array to file ==== | ||
| + | Below is array configs.txt:< | ||
| + | c1 = 0, | ||
| + | c2 = 51, | ||
| + | c3 = 26, | ||
| + | </ | ||
| + | update array to files: | ||
| <code bash> | <code bash> | ||
| - | grep -rnw babyshopvn -e "Begin Facebook Code" | + | index=0;for i in `cat configs.txt | awk ' |
| </ | </ | ||
linux/bashshell.1452833265.txt.gz · Last modified: (external edit)
