Hi.
I need help with loop for sed.
I have the script:
How can create loop for this?
The file - "test.txt" can contain 100 or more lines.
Thank you.
I need help with loop for sed.
I have the script:
Code:
cat test1.txt | sed -n 1,3p | jq -Rn \
--arg v1 / \
--arg v3 server1 \
'[inputs] | map({"{#NAME}" : $v1, "{#LIST}": ., "{#MARK}": $v3}) | { "data": . }'
cat test1.txt | sed -n 4,6p | jq -Rn \
--arg v1 / \
--arg v3 server1 \
'[inputs] | map({"{#NAME}" : $v1, "{#LIST}": ., "{#MARK}": $v3}) | { "data": . }'
cat test1.txt | sed -n 7,9p | jq -Rn \
--arg v1 / \
--arg v3 server1 \
'[inputs] | map({"{#NAME}" : $v1, "{#LIST}": ., "{#MARK}": $v3}) | { "data": . }'
How can create loop for this?
The file - "test.txt" can contain 100 or more lines.
Thank you.