Answer the question
In order to leave comments, you need to log in
How to remove a character in command output in Linux?
There is an output of a certain command in Linux (the whole output is one line):
[ { " *тут кучка данных*", "Last Share Time": "0:01:05", "*и тут еще кучка* } ]
sed "s/[0-9]\{1\}:[0-9]\{2\}/BLABLABLA/g"
Answer the question
In order to leave comments, you need to log in
It is possible in awk on your example. I use quotation marks as a delimiter.
VAR='[ { " *тут кучка данных*", "Last Share Time": "0:01:05", "*и тут еще кучка*" } ]'
echo "$VAR"
echo "$VAR" | awk 'BEGIN{FS="\"";OFS="\""} {gsub(/:|\;/,"",$6)}1'
I would jq -r
select the required fields with sed, then remove the ":" with sed.
Radjah for sure, and jq also has a developed data filter syntax (you need to look at the data exactly what to choose)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question