# sh weirdness with $PAGER



## graudeejs (Aug 2, 2011)

Hi!

I was wondering can anyone enlighten me why this:



happens.

Screenshot on left is with `$ playd cat | $PAGER`
Screenshot on right is with `$ playd list`

Relavent code:
*playd cat*: http://hg.bsdroot.lv/aldis/playd.sh/file/465f97f543bf/bin/playd.sh#l432
*playd list*: http://hg.bsdroot.lv/aldis/playd.sh/file/465f97f543bf/bin/playd.sh#l437 (same as *playd cat*, except that output is piped to $PAGER)

So pretty much *playd list* should be equivalent to *playd cat | $PAGER*, but it (*playd list*) doesn't show unicode characters.

For the sake of experiment I replaced */bin/sh* with */usr/local/bin/mksh* and I got same output.

I really want to fix this.


----------



## SirDice (Aug 2, 2011)

*$PAGER* is either set to less or more. Within the script *$PAGER* is set to more(1).


----------



## graudeejs (Aug 2, 2011)

No. script falls back to *more*, if env $PAGER is not set.

even *playd cat | more* works fine, while *playd list* doesn't even when (PAGER is not set)


----------



## graudeejs (Aug 2, 2011)

SirDice said:
			
		

> *$PAGER* is either set to less or more. Within the script *$PAGER* is set to more(1).



You're right... some bug, thanks


----------



## graudeejs (Aug 2, 2011)

I found out what was causing all this weirdo...

I forgot that playd can source config file from $PLAYD_HOME/playd.conf if such file exits.
In this file I had

```
PAGER=more
export LC_ALL=lv_LV.UFT-8
```

The second line was causing problems that you can see in screenshot, because my current locale is set to *en_GB.UTF-8*


----------

