0

i am getting output as
XYZ... ABC... This is \t\t\033[40m\033[32mUP\033[0m
instead of
XYZ... ABC... This is UP
i am trying to diplay "UP" in green colour.

below is the code:
#!/bin/bash

var=` /export/home/GT/AM/bin/xacct test -i | grep OK | wc -l`

if [[ var -eq 2 ]]; then
echo "This is \t\t\033[40m\033[32mUP\033[0m"
else
echo "This is \t\t\033[40m\033[31mDOWN\033[0m"
fi

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Gyani.gtst
0

Looks like you're on the right track! Try using 'echo -e'

In some shells, you might have to specify /bin/echo (or whatever your path is) rather than the 'echo' built into the shell.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.