echo append to file

Echo   is used many times in the shell programming process and input to the log file. There are two situations when writing a log. One is that the file is written to be empty at one time, and the previous content is overwritten when it is written again. How to implement additional content?

    1. Overwrite write:

      echo "log content"   >  file

    2. Append write:

      echo "log content"     >>  file

Echo   is used many times in the shell programming process and input to the log file. There are two situations when writing a log. One is that the file is written to be empty at one time, and the previous content is overwritten when it is written again. How to implement additional content?

    1. Overwrite write:

      echo "log content"   >  file

    2. Append write:

      echo "log content"     >>  file

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325650249&siteId=291194637