Pazartesi, Kasım 4, 2024

How to Strip White Space, Dash And Colons From Bash

yüksek çözünürlüklü bash script uygulama görseli

Pipe a timestamp string into sed combined to remove the -, : and white space to get a string which is suitable for a log file

echo -n "10-09-2020 09:00:00" | sed 's/-\|:\|\s//g'

It is very useful for dates or slice strings