![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Shell
NoGame_NoWork
这个作者很懒,什么都没留下…
展开
-
Shell:运算符
| 运算符 管道符号,是unix一个很强大的功能,符号为一条竖线:"|"。 用法: command1 | command2 他的功能是把第一个命令command 1执行的结果作为command2的输入传给command 2 例如: echo "aa bb cc" | awk -F '{print $1}' echo "aa bb cc" | awk -F '{print $2}' echo "aa bb cc" | awk -F '{print $3}' 输出为: aa bb cc原创 2022-02-12 16:49:39 · 494 阅读 · 0 评论 -
Shell:for循环的用法
links_dir为某一路径,links为某一txt格式文件 以下代码可以将links_dir目录下的links文件的每一行打印出来 for i in $(cat $links_dir/*links) do echo $i done原创 2022-02-12 16:35:40 · 134 阅读 · 0 评论 -
Shell:direname、readlink与BASH_SOURCE[0]获取当前脚本的绝对路径
username@ubuntu:~/$ dirname --help 用法:dirname [选项] 名称... Output each NAME with its last non-slash component and trailing slashes removed; if NAME contains no /'s, output '.' (meaning the current directory). -z, --zero end each output line with NUL,.原创 2022-02-09 16:57:44 · 1170 阅读 · 0 评论