【发布时间】:2012-07-02 01:25:47
【问题描述】:
我是印度尼西亚的学生,我想创建一个脚本,从包含以下文本的文件中删除几行:
zone "irf.com" {
type master;
file "db.irf.com";
allow-update { none; };
};
zone "friedrice.com" {
type master;
file "db.friedrice.com";
allow-update { none; };
};
zone "you.com" {
type master;
file "db.you.com";
allow-update { none; };
};
如果我想删除这个:
zone "friedrice.com" {
type master;
file "db.friedrice.com";
allow-update { none; };
};
在终端中我可以运行:
sh you.txt friedrice
shell编程中的语法是怎样的?
所有文本都在一个文件中,比如说you.txt
我是新手,请帮帮我
【问题讨论】:
-
请..不要命名你的配置或脚本文件
*.txt... -
虽然您已经收到了对具体问题的一些很好的答案,但它们相当于使用非结构化工具来操作结构化数据。您有区域数据,而不是 XML,但这是一个细节;这与stackoverflow.com/questions/701166/… 的问题基本相同