打開 系統COM port或是SOL logs 會發現一些密密麻麻很難辨識的文字或符號

善用控制輸出速度的指令,就能像慢速回放一樣,重新檢視console跟SOL的Log囉

To intentionally slow down console output in Linux, several methods can be employed:
1. Using pv (Pipe Viewer) for rate limiting:
The pv utility can be used to monitor the progress of data through a pipe and also to limit its transfer rate.
$ your_command | pv -L 5000  # Limits output to 10 lines per second

2. Introducing delays in a loop:
Piping output through a while read loop and adding a sleep command can introduce a delay between lines.
$ your_command | while read line; do echo "$line"; sleep 0.1; done

3. Using awk for line-by-line delays:
awk can be used to process each line and introduce a system sleep command.
$ your_command | awk '{ system("sleep 0.01"); print }'

4. Writing a custom script (e.g., Python):
A simple script in a language like Python can read input line by line and print it with a specified delay.
Python
---
#!/usr/bin/env python3
import sys
import time

delay_seconds = 0.1  # Adjust as needed
for line in sys.stdin:
    print(line, end='')
    time.sleep(delay_seconds)
---
Then, execute your command and pipe its output to this script:
$ your_command | python3 your_script.py

文章標籤
全站熱搜
創作者介紹
創作者 吾給力 的頭像
吾給力

吾給力的部落格

吾給力 發表在 痞客邦 留言(0) 人氣(4)