次のデータのシェルスクリプトを作成しようとしています
入力ファイルpage.txtの内容:
enter a first page title<br><div style="margin-left: 40px;">enter a first point <br></div><div style="margin-left: 80px;">enter a second point<br></div><div style="margin-left: 120px;">enter a third point<br></div><div style="margin-left: 80px;"><br></div><div style="margin-left: 40px;"><br></div><div style="margin-left: 40px;"><br></div>
アルゴリズム :
Read the pages file
Replace <br> with newline
Replace <div style="margin-left: 40px;"> with 1 tab
Replace <div style="margin-left: 80px;"> with 2 tab
Replace <div style="margin-left: 120px;"> with 3 tab
Replace <div style="margin-left: 160px;"> with 4 tab
私はこれを使おうとしています
tr '<br>' '\n' < page.txt
期待される出力ファイル
enter a first page title
enter a first point
enter a second point
enter a third point
上記のスクリプトの書き方を教えてください。