Seems as if the layout can't handle the [0x1b]
-character in front of the [
.
The first line makes bold:
echo -e "\x1b[1m bold"
echo -e "\x1b[30m black"
echo -e "\x1b[31m red"
echo -e "\x1b[32m green"
echo -e "\x1b[33m yellow"
echo -e "\x1b[34m blue"
echo -e "\x1b[35m mag"
echo -e "\x1b[36m cyan"
echo -e "\x1b[37m white"
For the general type, I only know
echo -e "\x1b[0m io-std"
echo -e "\x1b[1m bold"
echo -e "\x1b[2m normal"
and from the comments, thanks manatwork and GypsyCosmonaut:
echo -e "\x1b[3m italic"
echo -e "\x1b[4m underlined"
echo -e "\x1b[5m blinking"
echo -e "\x1b[7m inverted"
and don't know the difference between io-std and normal.
I haven't seen italic or small in the shell.
You can enter them (thanks to manatwork too) by Ctrl + v ESC in the Bash, where it will be displayed as ^[
. This mean the whole ANSI sequence will look like ^[[1m bold
or ^[[1mbold
(to avoid the blank before 'bold').
Many editors have problems with (char)0x1b. Alternatives: copy/paste it from somewhere, or use
echo -e "\x1b[1m bold"
in bash, or a hex editor.
Or, even simpler:
echo -e "\e[1m bold"
The \e
is an escape sequence for the ascii code 27, for the bash internal command echo as well as for the external program GNU-echo.