I'm trying pass a curl
request and From response body , Im trying to grep for a key word "coin". If "coin
" word matches , I need to get either "0" or "1" with the input URL as a prefix
( comma delineated
).
$for i in $(cat small);do curl -i -H "Accept: application/json" $i | grep "coin";echo $? | sed "s/^\(.\)/$i,\1/";done
#cat small
http://cuevana0.tv/
https://www.1111data.com/
I'm adding input as a prefix to the result "sed "s/^(.)/$i,\1/".
But i'm getting error as
$ for i in $(cat small);do curl -i -H "Accept: application/json" $i | grep "coin";echo $? | sed "s/^\(.\)/$i,\1/";done
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 633k 0 633k 0 0 909k 0 --:--:-- --:--:-- --:--:-- 908k
<script src="https://coin-hive.com/lib/coinhive.min.js"></script>
sed: -e expression #1, char 16: unknown option to `s'
Any suggestions on how to solve this ? Though the above is not a good practice , But it will help me timely.
Expected Result :
http://cuevana0.tv/,0