摘要:
4种; 01、bash a.sh 02、sh a.sh 03、. a.sh 04、source 前两种会重开shell终端; 后两种是本shell; 测试如下: 001、测试前两种方法;不影响当前路径 [root@pc1 test1]# ls a.sh [root@pc1 test1]# pwd # 阅读全文
posted @ 2024-02-20 15:14
小鲨鱼2018
阅读(42)
评论(0)
推荐(0)
摘要:
001、问题 shell终端下,双引号内输出!报错 [root@pc1 test1]# echo "hello world!" -bash: !": event not found 002、问题原因 终端中! 表示执行历史命令。 003、解决方法 a、使用单引号 [root@pc1 test1]# 阅读全文
posted @ 2024-02-20 14:48
小鲨鱼2018
阅读(65)
评论(0)
推荐(0)
摘要:
001、 [root@pc1 test1]# ls a.txt [root@pc1 test1]# cat a.txt ## 测试文本 aa bb cc kk ee ss ff uu zz vv ee ww ## sed预存储抽取文件的第一列 [root@pc1 test1]# sed -r 's/ 阅读全文
posted @ 2024-02-20 12:25
小鲨鱼2018
阅读(80)
评论(0)
推荐(0)
摘要:
-r:其中一项作用是保证字符为其本身字符; 没有-r字符具有正则意义; 如下例子: 001、 一下命令用于sed删除开头的空格 [root@pc1 test1]# ls a.txt [root@pc1 test1]# cat a.txt ## 测试文本 01 02 03 04 05 06 07 08 阅读全文
posted @ 2024-02-20 11:38
小鲨鱼2018
阅读(847)
评论(0)
推荐(0)
摘要:
001、输出偶数行 [root@pc1 test1]# ls a.txt [root@pc1 test1]# cat a.txt ## 测试文本 01 01 02 02 03 03 04 04 05 05 06 06 07 07 08 08 09 09 10 10 [root@pc1 test1]# 阅读全文
posted @ 2024-02-20 11:01
小鲨鱼2018
阅读(222)
评论(0)
推荐(0)
摘要:
001、整体重复 a、 [root@pc1 test1]# ls a.txt [root@pc1 test1]# cat a.txt ## 测试文本 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 [root@pc1 test1 阅读全文
posted @ 2024-02-20 10:51
小鲨鱼2018
阅读(26)
评论(0)
推荐(0)

浙公网安备 33010602011771号