0

i have the following command:

echo -n $i". "${!ip}" - " ;curl -X POST http://${!ip}:50333/api/v1/version; echo " "

I want the output to be green so what i did was

echo -n -e "\e[32m$i". "${!ip}" - " ;curl -X POST http://${!ip}:50333/api/v1/version; echo " "\e[0m"

but that returns the curl command in text and not the output.

  1. 192.168.1.232 - ;curl -X POST http://192.168.1.232:50333/api/v1/version; echo

how do i exclude the entire curl command from the text ""

0

You have also enclosed the semicolon and the curl command in quotes, so that also gets echoed.

Try:

echo -n -e "\e[32m$i ${!ip} - "; curl -X POST http://${!ip}:50333/api/v1/version; echo "\e[0m"
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.