Tagged Questions
6
votes
4answers
2k views
printing colored text using echo
I know that for printing a colored text using echo, for example red color, the code is: echo -e "\e[1;31m This is red text \e[0m"
and I know that in this example, 31 is code of red color and the ...
1
vote
2answers
1k views
How can I trim the carriage return from text that is being piped in bash?
I'm using this command to get my last typed command:
history | cut -c 8- | tail -n 2 | head -n 1
It works very well in bash, removing the line numbers, but there is one problem I have with it, (er, ...