我是新手,sed文件要在怎么写? 在emacs里写吗?怎样才能得到 .sed 文件?
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/07/18 18:19:20
我是新手,sed文件要在怎么写? 在emacs里写吗?怎样才能得到 .sed 文件?
![我是新手,sed文件要在怎么写? 在emacs里写吗?怎样才能得到 .sed 文件?](/uploads/image/z/18331497-9-7.jpg?t=%E6%88%91%E6%98%AF%E6%96%B0%E6%89%8B%2Csed%E6%96%87%E4%BB%B6%E8%A6%81%E5%9C%A8%E6%80%8E%E4%B9%88%E5%86%99%3F%E3%80%80%E5%9C%A8emacs%E9%87%8C%E5%86%99%E5%90%97%3F%E6%80%8E%E6%A0%B7%E6%89%8D%E8%83%BD%E5%BE%97%E5%88%B0%E3%80%80.sed+%E6%96%87%E4%BB%B6%3F)
其实脚本文件可以用任何文本编辑器,只不过对于新手,这样的工具会比较难,给你
个英文学习资料吧,专门介绍这个的.
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/
个英文学习资料吧,专门介绍这个的.
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/