Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

The code below runs well in Bash and shows text with proper green background color but when I add it to the ~/.byobu/bin/ folder it shows the escape characters instead. Something like [42m[1mAAPL:30.345 (B[m

#!/bin/sh
echo `tput setab 2;tput bold`AAPL:`curl -s 'http://download.finance.yahoo.com/d/quotes.csv?s=AAPL&f=sl1d1t1c1ohgv&e=.csv' | cut -d, -f2;tput sgr0`
share|improve this question

1 Answer 1

You need other color specifiers in screen (see Manpage of screen(1)). So first you should save the value in a variable:

AAPL=$(curl -s 'http://download.finance.yahoo.com/d/quotes.csv?s=AAPL&f=sl1d1t1c1ohgv&=.csv' | cut -d, -f2)

And in the second step you can output it with printf:

printf "\005{= b}%s%s\005{-}" "AAPL: " "$AAPL"
share|improve this answer
    
...I'm having precisely the same issue with the tmux backend –  badp Jul 11 at 13:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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