shell

bash

description synopsis options single character options multi character options arguments invocation definitions reserverd_words shell grammar simple commands pipelines lists compound commands coprocesses 函数定义 comments quoting parameters positional parameters special parameters shell variables array expansion brace expansion tilde expansion parameter expansion command substitution arithmetic expansion process substitution word splitting pathname expansion quote removal redirection input output appending redirected output redirecting standard output and standard error appending standard output

expect 脚本

expect 是用来进行自动化控制和测试的工具,可以执行交互式的脚本 在执行脚本过程中,一些交互式的过程可能需要用户输入等信息,这种情况下课使用 expect 脚本 基本

perl 脚本解析 xml 文件

1 使用模块 XML::Simple。XML::Simple 能够解析一个 XML 文件并在以一个 Perl 哈希引用返回数据。在这个哈希中,来自原始 XML 文件的元素作

shell 脚本

在 shell 脚本中调用另一个脚本 shell 命令行选项解析 getopts getopt shell 获取脚本的进程 ID shell 脚本获取当前时间 shell 执行多个命令的方法 shell test 命令 数值测试 字符串测试 文件测试 连接测

命令行创建文件

cat touch 标准重定向符号 > echo/printf nano vi/vim cat cat 可用于创建文件。输入回车后,光标移到到下一行,可以开始输入文本。完成之后使用 Ctrl+D 退出,并返回到提示符 cat > file_name cat 也可