[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

How can I get rid of these funny characters?

Has anyone had problems with control characters in
their output.  Every time I pipe a directory listing
to less, for instance, I get the following output:

[user]$ ls -l | less
ESC[00mtotal 62544
-rwxr-xr-x    1 root     root          207 Mar 13
10:26 ESC[01;32mcontroldb-backupdb.shESC[00m*
-rwxr--r--    1 root     root          106 Mar 13
10:26 ESC[01;32mcontroldb-bashprofileESC[00m*
-rwxr-xr-x    1 root     root        16858 Jan 31
04:34 ESC[01;32mcontroldb-configmgr.sqlESC[00m*
-rwxr-xr-x    1 root     root          108 Mar 13
10:27 ESC[01;32mcontroldb-cronfile.shESC[00m*

It should produce the file names
controldb-backupdb.sh, controldb-bashprofile,
controldb-configmgr.sql, and controldb-cronfile.sh. 
This problem doesn't only show up when piping to less.
 It has also happened when I tried saving a filename
to a variable from the command line, such as:

[user]$ for i in `ls control*`
>j=`echo $i|sed -e 's/control/new/g'`
>mv $i $j

The $j variable contains the same control characters
shown in the previous listing instead of just the
filename with "control" replaced by "new".  Has anyone
else had this problem and how did you fix it?  My
$TERM is "xterm" and I have already tried changing it
to ansi, vt100, and vt220 with no success.  I also
tried stty sane with no success.  Please help.


Do you Yahoo!?
Yahoo! Web Hosting - establish your business online

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]