Unix tail and grep equivalent for Windows

前端 未结 2 1203
青春惊慌失措
青春惊慌失措 2021-01-26 22:16

We have the following unix command:

/usr/bin/tail -n 1 %{path} | grep --silent -F \"%{message}\" && rm -f %{path}%

This:

2条回答
  •  自闭症患者
    2021-01-26 23:06

    You can use tailhead.bat (pure batch script utility) that can be used to show lasts/fists lines of a file.Instead of Grep you can use findstr or find :

    tailhead.bat tailhead -file=%pathToFile% -begin=-3|find  "%message%"
    

提交回复
热议问题