Sed - An Introduction and Tutorial by Bruce Barnett
Do not fret!?It is not your fault you don't understand?sed. I will cover?sed?completely. But I will describe the features in the order that I learned them. I didn't learn everything at once. You don't need to either. 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/ 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/ This will output "night". I didn't put quotes around the argument because this example didn't need them. If you read my earlier tutorial?,you would understand why it doesn't need quotes. However,I recommend you do use quotes. If you have meta-characters in the command,quotes are necessary. And if you aren't sure,it's a good habit,and I will henceforth quote future examples to emphasize the "best practice." Using the strong (single quote) character,that would be: sed 's/day/night/' I must emphasize that the sed editor changes exactly what you tell it to. So if you executed echo Sunday | sed 's/day/night/' This would output the word "Sunnight" because sed found the string "day" in the input. Another important concept is that sed is line oriented. Suppose you have the input file: one two three,one two three four three two one one hundred and you used the command sed 's/one/ONE/' |
- linux ss 命令
- 一文理解JVM虚拟机(内存、垃圾回收、性能优化)解决面试中
- Install Tomcat 6 on CentOS or RHEL --转载
- 爆料:卓越游戏或与“都叫兽”合作 传双方正洽谈
- debian set eth0 autoneg off speed 1000 duplex full:参数
- java – 在Eclipse中隐藏的android logcat消息
- 360奇酷手机怎么截图 奇酷手机2种截屏方式的教程
- linux安装redis redis注册服务
- 红雪打开会弹窗,关于Couldn't load Mobiledevice.dll解决办
- linux – Heartbeat,Pacemaker和CoroSync的替代品?