作业帮 > 综合 > 作业

我是新手,sed文件要在怎么写? 在emacs里写吗?怎样才能得到 .sed 文件?

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/15 05:35:03
我是新手,sed文件要在怎么写? 在emacs里写吗?怎样才能得到 .sed 文件?
其实脚本文件可以用任何文本编辑器,只不过对于新手,这样的工具会比较难,给你
个英文学习资料吧,专门介绍这个的.
http://www.grymoire.com/Unix/Sed.html#uh-0
例子:Sed has several commands, but most people only learn the substitute command: s. The substitute command changes all occurrences of the regular expression into a new value. A simple example is changing "day" in the "old" file to "night" in the "new" file:
sed s/day/night/ new
Or another way (for Unix beginners),
sed s/day/night/ old >new
and for those who want to test this:
echo day | sed s/day/night/