我有一个像bellow一样的日志文件:
Jan 01 This the log of this day.
Jan 01 This the log of this day.
Jan 01 This the log of this day.
Jan 01 This the log of this day.
Jan 01 This the log of this day.
Jan 01 This the log of this day.
Jan 01 This the log of this day.
Jan 01 This the log of this day.
Jan 01 This the log of this day.
Jan 01 This the log of this day.
Jan 02 This the log of this day.
Jan 02 This the log of this day.
Jan 02 This the log of this day.
Jan 02 This the log of this day.
Jan 02 This the log of this day.
Jan 02 This the log of this day.
Jan 02 This the log of this day.
Jan 02 This the log of this day.
Jan 02 This the log of this day.
Jan 02 This the log of this day.
Jan 02 This the log of this day.
Jan 03 This the log of this day.
Jan 03 This the log of this day.
Jan 03 This the log of this day.
Jan 03 This the log of this day.
Jan 03 This the log of this day.
Jan 03 This the log of this day.
Jan 03 This the log of this day.
Jan 03 This the log of this day.
Jan 03 This the log of this day.
Jan 03 This the log of this day.
Jan 03 This the log of this day.
我怎么能在白天拆分文件?我用了命令:
csplit log /*Jan 01*/ /*Jan 02*/ /*Jan 03*/
但有错误:
csplit: /*Jan: closing delimiter '/' missing
所以任何人都可以告诉我如何解决这个问题?提前谢谢。
答案 0 :(得分:1)
shell将/*Jan
视为一个参数,将01*/
视为另一个参数,依此类推。您需要引用具有嵌入空格的参数。
csplit log '/*Jan 01*/' '/*Jan 02*/' '/*Jan 03*/'