Can't split a text file based on separator

后端 未结 2 1493
独厮守ぢ
独厮守ぢ 2021-01-26 06:51

I\'m running Ubuntu 18.04 LTS. I have a text file named \"group_keys\", which contains a number of public keys that I\'d like to split based on the delimiter

---         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-26 07:29

    This should work:

    awk '/-----BEGIN PUBLIC KEY-----?/{n++}{print > "person_" n "_key" }' group_keys

提交回复
热议问题