Fix strange characters from pstree on RedHat.

By default on Redhat, the output from pstree is scrambled like this:

initââ¬âEvMgrCâââEvMgrCâââ4*[EvMgrC]
     ââatd
     ââbdflush
     ââcrondâââcrondâââshâââwget
     ââcvdâââcvdâââ8*[cvd]
     ââhttpdâââ31*[httpd]
     ââirqbalance
     ââkeventd
     ââkhubd
     ââ2*[kjournald]
     ââklogd
     ââkscand
     ââksoftirqd/0
     ââksoftirqd/1
     ââksoftirqd/2
     ââksoftirqd/3
     ââkswapd
     ââkupdated
     ââmdrecoveryd
     ââ6*[mingetty]
     ââminiserv.pl
     ââmysqld_safeâââmysqld
     âânsrexecdââânsrexecd
     ââportmap
     ââ2*[portsentry]
     âârhnsd
     ââsaslauthdâââ4*[saslauthd]
     ââscsi_eh_0
     ââsshdâââsshdâââsshdâââbashâââsuâââbashâââpstree
     ââsvscanbootââ¬âreadproctitle
     â            ââsvscanââ¬âsuperviseâââqmail-sendââ¬âqmail-clean
     â                     â                        ââqmail-lspawn
     â                     â                        ââqmail-rspawn
     â                     ââ3*[superviseâââmultilog]
     â                     ââsuperviseâââtcpserverâââ6*[rblsmtpdâââfixcrio]
     â                     ââsuperviseâââtcpserver
     ââsyslogd
     ââvsftpd
     ââxinetd

There are a couple of ways to clear this up so that it looks like this:

init─┬─EvMgrC───EvMgrC───4*[EvMgrC]
     ├─atd
     ├─bdflush
     ├─crond
     ├─cvd───cvd───8*[cvd]
     ├─httpd───22*[httpd]
     ├─irqbalance
     ├─keventd
     ├─khubd
     ├─2*[kjournald]
     ├─klogd
     ├─kscand
     ├─ksoftirqd/0
     ├─ksoftirqd/1
     ├─ksoftirqd/2
     ├─ksoftirqd/3
     ├─kswapd
     ├─kupdated
     ├─mdrecoveryd
     ├─6*[mingetty]
     ├─miniserv.pl
     ├─mysqld_safe───mysqld
     ├─nsrexecd───nsrexecd
     ├─portmap
     ├─2*[portsentry]
     ├─rhnsd
     ├─saslauthd───4*[saslauthd]
     ├─scsi_eh_0
     ├─sshd───sshd───sshd───bash───su───bash───pstree
     ├─svscanboot─┬─readproctitle
     │            └─svscan─┬─supervise───qmail-send─┬─qmail-clean
     │                     │                        ├─qmail-lspawn
     │                     │                        └─qmail-rspawn
     │                     ├─3*[supervise───multilog]
     │                     ├─supervise───tcpserver───12*[rblsmtpd───fixcrio]
     │                     └─supervise───tcpserver
     ├─syslogd
     ├─vsftpd
     └─xinetd

Here are two possible solutions:

1. Use “pstree -G” to force VT100 line drawing

2. Do “export LANG=’en_US’” to change the language from UTF-8 to English

blog comments powered by Disqus