我想根據某個標籤從文件中讀取摘錄信息。例如:使用bash逐行讀取文件,提取一些數據。怎麼樣?
SCRIPT_NAME:mySimpleShell.sh
This is a simple shell. I would like to have this as
Description. I also want to create a txt file our of this.
SCRIPT_NAME:myComplexShell.sh
This is a complex shell. I would like to have this as
Description. I also want to create a txt file our of this.
所以,當我通過這個文件,以我的shell腳本,我的shell會逐行閱讀並 當它到達SCRIPT_NAME,它提取它,並將它保存在$ FILE_NAME,然後開始使用$ FILE_NAME.txt名稱將 描述寫入磁盤上的文件。直到達到文件末尾。如果有3個SCRIPT_NAME標記,則它會創建3個描述文件。
謝謝你幫我提前:)