Temp

7806 bookmarks
Custom sorting
编写安全健壮的shell脚本
编写安全健壮的shell脚本
编写shell脚本容易出现的问题:比如变量为空的时候,管道报错等,容易引起一系列问题甚至灾难性的结果。可以借助工具https://www.shellcheck.net/来检查脚本里面可以改进的地方。 脚本里使用set建议使用 1set -euo pipefail set -oset -o 可以查看shell的选项开关,比如常用的pipefail 1set -o | pipefail pipef
·zahui.fan·
编写安全健壮的shell脚本
Shell 参数扩展及各类括号在 Shell 编程中的应用 - leejun2005的个人页面 - OSCHINA - 中文开源技术交流社区
Shell 参数扩展及各类括号在 Shell 编程中的应用 - leejun2005的个人页面 - OSCHINA - 中文开源技术交流社区
今天看有人总结了 shell 下的参数扩展,但不是很全,恰好以前整理过放在百度空间,但百度空间目前半死不活的情况下对 Google 非常不友好,索性一并转过来方便查阅。 1、bash 中的大括号参数扩展(Parameter Expansion) 假设我们定义了一个变量为: file=/dir1/dir2/dir3/my.file.txt 1.1 bash 下的 split 取“数组”的首...
·my.oschina.net·
Shell 参数扩展及各类括号在 Shell 编程中的应用 - leejun2005的个人页面 - OSCHINA - 中文开源技术交流社区
【Linux】Shell命令 getopts/getopt用法详解_镰刀韭菜的博客-CSDN博客_get opt shell
【Linux】Shell命令 getopts/getopt用法详解_镰刀韭菜的博客-CSDN博客_get opt shell
Shell命令行参数解析getopts/getopt用法详解在Linux bash中,可以用以下三种方式解析命令行参数:直接处理:使用$1,$2,$3…进行解析getopts: 单个字符选项的情况,例如:-n 10 -f file.txt等选项getopt:处理单个字符或长选项(long-option),例如:–prefix=/home等经验:小型脚本可以直接处理,大多数情况使用get...
·blog.csdn.net·
【Linux】Shell命令 getopts/getopt用法详解_镰刀韭菜的博客-CSDN博客_get opt shell
关于Bash的内置getopts命令
关于Bash的内置getopts命令
一直以来,我都是用getopt为shell脚本进行命令行参数解析,一路也都工作得很好。直到我遇上了MacOS。getopt是一个单独的命令,在MacOS上的版本和Linux上的不同,用法并不兼容,导致命令行脚本在MacOS下工作不正常。
·thawk.github.io·
关于Bash的内置getopts命令
Using Functions Inside Go Templates - Calhoun.io
Using Functions Inside Go Templates - Calhoun.io
Go's template package provides many useful built-in functions. Learn to use a few of the more common ones, as well as how to add custom fucntions to your templates so that you can add any functionality you need.
·calhoun.io·
Using Functions Inside Go Templates - Calhoun.io
[译]Golang template 小抄
[译]Golang template 小抄
这是 Curtis Vermeeren 做的 Go模板技术的小抄,这是我非常喜欢的形式,可以以一个简短的总结把相关的技术介绍出来。 大家可以看我以前翻译的Go文件操作大全,也是统一风格的文章。我翻译了这篇文章,补充了遗漏的知识点。 Go标准库提供了几个package可以产生输出结果,而text/template 提供了基于模板输出文本内容的功能。html/template则是产生 安全的HTML格
·colobu.com·
[译]Golang template 小抄
JSON vs. YAML vs. TOML
JSON vs. YAML vs. TOML
There are a bunch of data formats which can store structured data. The most popular seem to be JSON and YAML. A relatively new one is TOML, which is gaining traction in the Python ecosystem. For most
·martin-ueding.de·
JSON vs. YAML vs. TOML
聊一聊TOML
聊一聊TOML
最近配置 Gitlab Runner,发现他的配置文件是.toml后缀。对toml类型一番了解之后,发现这是个非常值得使用的配置文件语言。 TOML的由来TOML是Tom's Obvious, Minimal Language.的首字母缩写,是Tom的浅显的、极简的语言。那么问题来了,Tom是谁?搜索之后得到答案,Tom是Tom Preston-Werner,全球最大的同性交友网站Gith
·ldsink.com·
聊一聊TOML