- Learning Linux Shell Scripting
- Ganesh Naik
- 144字
- 2021-06-25 22:02:52
Pattern matching with the vi editor
To learn about pattern matching, we will ensure that the pattern that we will search for is highlighted when the pattern searched for is found. The configuration file for vi is /etc/vimrc.In the vi editor, use the following commands for various options:

The following is an example of a regular expression for replacing Tom with David:
:1,$s/tom/David/g // from line 1 to end ($), replace tom by David :1,$s/<[tT]om>/David/g // start and end of word < >
This is another example of a regular expression. Create the love.txt file, as follows:
Man has love for Art
World is full of love
Love makes world wonderful
love looove lve
love
Love love lover loves
I like "Unix" more than DOS
I love "Unix"/
I said I love "Unix"
I love "unix" a lot
Use the following commands for testing pattern-searching facilities:

推薦閱讀
- Mastering Hadoop 3
- Python Artificial Intelligence Projects for Beginners
- 群體智能與數據挖掘
- 完全掌握AutoCAD 2008中文版:綜合篇
- 計算機系統結構
- 從零開始學C++
- 單片機技能與實訓
- 機器人人工智能
- INSTANT Munin Plugin Starter
- Photoshop CS5圖像處理入門、進階與提高
- 嵌入式GUI開發設計
- 電氣控制與PLC原理及應用(歐姆龍機型)
- Mastering Text Mining with R
- Effective Business Intelligence with QuickSight
- DynamoDB Applied Design Patterns