2023-02-02

[쉘] 바이너리 파일에서 추출하여 버전빼기


grep -a "\$Revision.*\$" /usr/local/network_adapter.bin 를 실행하면 아래와 같이 추출해준다.
$Id: ESP32 $ $Date: Feb  1 2023 22:28:54 $ $Revision: 0.0.5.std $

이걸 이용해서 추가해서 0.0.5.std 만 추출하고싶다.
grep -a "\$Revision.*\$" /usr/local/network_adapter.bin | cut -d "$" -f6 | cut -d " " -f2
0.0.5.std


댓글 없음:

댓글 쓰기

How to Convert EUC-KR Source Code to UTF-8

How to Convert EUC-KR Source Code to UTF-8 I found old STM32 firmware code. The files were in EUC-KR encoding. This is an old Korean text f...