Reputation: 205
I have a bash file
#!/bin/bash
curl '/entry/point.json?name=ab'
echo 1
sleep 60
curl '/entry/point.json?name=bc'
echo 2
sleep 60
and so on. I'd like to append
|jsonpp
after each curl command. How am I supposed to do that in VI? Such as
:%s/curl/?????/g
Upvotes: 1
Views: 70
Reputation: 393174
:global
:g/curl/norm A|jsonpp
would be my favourite
curl
(using *
or #
)|jsonpp
EscAlternatively,
#!/bin/bash
function curl()
{
/usr/bin/curl "$@" | jsonpp
}
curl '/entry/point.json?name=ab'
echo 1
sleep 60
curl '/entry/point.json?name=bc'
echo 2
sleep 60
Upvotes: 1