当前位置: 首页 > news >正文

微信怎么开店铺小程序福州seo网站推广优化

微信怎么开店铺小程序,福州seo网站推广优化,平安银行官方网站,颍上建设局网站大家好,今天分享一款开源工具--shellcheck。 shellcheck 简介 今天发现的一款神器,如果你日常会接触到shell脚本,或者说自己需要写一些shell脚本,那么强烈建议你用下这个工具。 shellcheck一个静态的shell脚本分析工具&#xf…

大家好,今天分享一款开源工具--shellcheck。

shellcheck 简介

今天发现的一款神器,如果你日常会接触到shell脚本,或者说自己需要写一些shell脚本,那么强烈建议你用下这个工具。

shellcheck一个静态的shell脚本分析工具,可以判断脚本哪里有异常,哪里可以优化,并且会给出对应的解决办法。

一个简单的示例:

图片

这款工具不仅适用于初学者,对于中高级使用者帮助更大。

安装

github可以访问的直接到如下链接去下载就可以,目前支持多个终端,也有web可访问

https://github.com/koalaman/shellcheck

web访问地址:https://www.shellcheck.net/

使用方式:

shell脚本中的一些常见错误

  1. 常见错误引用

echo $1                           # Unquoted variables
find . -name *.ogg                # Unquoted find/grep patterns
rm "~/my file.txt"                # Quoted tilde expansion
v='--verbose="true"'; cmd $v      # Literal quotes in variables
for f in "*.ogg"                  # Incorrectly quoted 'for' loops
touch $@                          # Unquoted $@
echo 'Don't forget to restart!'   # Singlequote closed by apostrophe
echo 'Don\'t try this at home'    # Attempting to escape ' in ''
echo 'Path is $PATH'              # Variables in single quotes
trap "echo Took ${SECONDS}s" 0    # Prematurely expanded trap
unset var[i]                      # Array index treated as glob
  1. 常见错误条件语句

[[ n != 0 ]]                      # Constant test expressions
[[ -e *.mpg ]]                    # Existence checks of globs
[[ $foo==0 ]]                     # Always true due to missing spaces
[[ -n "$foo " ]]                  # Always true due to literals
[[ $foo =~ "fo+" ]]               # Quoted regex in =~
[ foo =~ re ]                     # Unsupported [ ] operators
[ $1 -eq "shellcheck" ]           # Numerical comparison of strings
[ $n && $m ]                      # && in [ .. ]
[ grep -q foo file ]              # Command without $(..)
[[ "$$file" == *.jpg ]]           # Comparisons that can't succeed
(( 1 -lt 2 ))                     # Using test operators in ((..))
[ x ] & [ y ] | [ z ]             # Accidental backgrounding and piping
  1. 误用的命令

grep '*foo*' file                 # Globs in regex contexts
find . -exec foo {} && bar {} \;  # Prematurely terminated find -exec
sudo echo 'Var=42' > /etc/profile # Redirecting sudo
time --format=%s sleep 10         # Passing time(1) flags to time builtin
while read h; do ssh "$h" uptime  # Commands eating while loop input
alias archive='mv $1 /backup'     # Defining aliases with arguments
tr -cd '[a-zA-Z0-9]'              # [] around ranges in tr
exec foo; echo "Done!"            # Misused 'exec'
find -name \*.bak -o -name \*~ -delete  # Implicit precedence in find
# find . -exec foo > bar \;       # Redirections in find
f() { whoami; }; sudo f           # External use of internal functions
  1. 初学者常见错误

var = 42                          # Spaces around = in assignments
$foo=42                           # $ in assignments
for $var in *; do ...             # $ in for loop variables
var$n="Hello"                     # Wrong indirect assignment
echo ${var$n}                     # Wrong indirect reference
var=(1, 2, 3)                     # Comma separated arrays
array=( [index] = value )         # Incorrect index initialization
echo $var[14]                     # Missing {} in array references
echo "Argument 10 is $10"         # Positional parameter misreference
if $(myfunction); then ..; fi     # Wrapping commands in $()
else if othercondition; then ..   # Using 'else if'
f; f() { echo "hello world; }     # Using function before definition
[ false ]                         # 'false' being true
if ( -f file )                    # Using (..) instead of test

资源获取:

(1)自己从 github 仓库拉取。

http://www.ds6.com.cn/news/51333.html

相关文章:

  • 自己可以做网站吗嘉兴网站建设方案优化
  • B2B第三方网站建设的流程优化关键词哪家好
  • 百度推广开户费用标准百度seo快速排名优化软件
  • 建筑网站推荐知乎app怎么推广运营
  • 自建博客网站阿里云免费建站
  • 台州网站建设公司.广州网站设计专注乐云seo
  • 怎样做集装箱网站四川省人民政府官网
  • 推荐几个好看的网站域名注册查询官网
  • 网站建设视频教程百度荤seo公司
  • 做移动端网站乐山网站seo
  • 开发公司安全生产管理制度免费seo教程分享
  • 浙江省建设信息港网站个人模板建站
  • 继续加强网站建设大侠seo外链自动群发工具
  • 建设网络强国征文seo手机排名软件
  • 做网站数据库要哪一种好线上营销方式
  • 搭建平台网站seo专业术语
  • 网站推广连接怎么做的大数据营销是什么
  • 手机版网站开发的功能点农村电商平台
  • 如何优化wordpress网站百度网址提交入口平台
  • 创业做网站还是软件好营销网站建设哪家好
  • dedecms新网站 上传到万网的空间泰安网站推广优化
  • 阿里备案成功后怎么做网站武汉今日头条最新消息
  • wordpress 知识 管理梅花seo 快速排名软件
  • 有没有可以做翻译的网站企业网站设计方案
  • 网站做推广企业游戏推广员判几年
  • 我市强化属地网站建设建设网站制作
  • onethink做的企业网站长沙百度提升排名
  • 邹城有做网站的吗开发一个app需要多少钱?
  • 广州做网站建设刘雯每日资讯
  • 有做美食的视频网站么我为什么不建议年轻人做运营