If the file is a. css file or a. js file, it is processed.
File=$1
if ["${file##*.}" x = "css" x]| | ["${file##*.}" x = "JS" x];then
Do something
Fi
Attention:
1> extract file suffix name: ${file##*.}
# #是贪婪操作符, matching from left to right, matching to the rightmost., removing the left content that contains the. Number.
Here you can refer to http://www.1987.name/264.html
2> is =, and there are spaces on both sides, if there is no space, will error
3> added x to prevent string errors from being empty times.
Here you can refer to http://qubaoquan.blog.51cto.com/1246748/292461
Find the file name in the current directory that contains. py,.sh,.css,.js,.html,
For n in ' find. -name "*.py"-o-name "*.sh"-o-name "*.css"-o-name "*.js"-o-name "*.html" "; Todo
Something
Done
Attention:
1> find the name of the file at the end of the current directory as. py, or. sh, or. css, or. js, or. html, and handle