The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - General (http://hintsforums.macworld.com/forumdisplay.php?f=16)
-   -   ls --color=auto (make this stick?) (http://hintsforums.macworld.com/showthread.php?t=8510)

webgodjj 01-13-2003 10:18 AM

ls --color=auto (make this stick?)
 
I would like to get this to work:
1. Color for ls in term.app
2. Color syntax for any text editor in term.app

I know that it is possible to do the first. ie if I type
ls --color=auto
I get a listing with colorized folders and files. Now I need to know how to make this stick... ie what file do I write to and what do I put into it.

2. I don't know if this is possible. I read somewhere that possibly emacs that came with jaguar does this.... How does this work? Are there others?

Maybee I need to use a different app then Terminal.app?

I am using the tcsh shell and here is my ~/ directory
Code:

.                    .cshrc          .tcshrc.save  Applications  Public
..                  .cvspass        .vegastrike  Desktop      Sites
.CFUserTextEncoding  .gimp-1.2      .xftcache    Documents    darkstat.db
.DS_Store            .lpoptions      .xinitrc      Library
.ICEauthority        .mysql_history  .xsmFmHKvo    Movies
.Trash              .ssh            .xt          Music
.Xauthority          .tcshrc        .yafc        Pictures


sao 01-13-2003 10:46 AM

webgodjj,

Install with Fink the package fileutils. The tools supplied with this package are:
Quote:

* chgrp - Changes file group ownership.
* chown - Changes file ownership.
* chmod - Changes file permissions.
* cp - Copies files.
* dd - Copies and converts a file.
* df - Shows disk free space on filesystems.
* dir - Gives a brief directory listing.
* dircolors - Setup program for the color output of GNU ls.
* du - Shows disk usage on filesystems.
* install - Copies file and sets its permissions.
* ln - Creates file links.
* ls - Lists directory contents.
* mkdir - Creates directories.
* mkfifo - Creates FIFOs (named pipes).
* mknod - Creates special files.
* mv - Moves files.
* rm - Removes (deletes) files.
* rmdir - Removes empty directories.
* shred - Destroy data in files.
* sync - Synchronizes filesystem buffers and disk.
* touch - Changes file timestamps.
* vdir - Long directory listing.
Then read the following threads:

http://forums.macosxhints.com/showth...ERM+xtermcolor

http://forums.macosxhints.com/showth...c&pagenumber=2


Cheers...

webgodjj 01-13-2003 10:57 AM

Ok.. I got that to work. Now how about getting syntax highlighting to work? I do alot of programming in PHP. I usually use BBEDIT, however, at times it is useful to use the terminal....

Thanks again!

DMCrimson 12-13-2003 08:22 PM

I had fileutils installed under jaguar, it compiled nicely without fink... but now in panther 10.3.1, no go, had to resort to fink's aid on this...


SNIP
In file included from /usr/include/machine/param.h:30,
from /usr/include/sys/param.h:102,
from /usr/include/netdb.h:84,
from canon-host.c:36:
/usr/include/ppc/param.h:98: macro "btodb" requires 2 arguments, but only 1 given
/usr/include/ppc/param.h:100: macro "dbtob" requires 2 arguments, but only 1 given
make[3]: *** [canon-host.o] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
[dmcrimson][fileutils-4.1]$


param.h seems to be phooked somehow...

vancenase 12-13-2003 09:56 PM

Quote:

Originally posted by webgodjj
Ok.. I got that to work. Now how about getting syntax highlighting to work? I do alot of programming in PHP. I usually use BBEDIT, however, at times it is useful to use the terminal....

Thanks again!
i like to use either one of these:
- vi or vim (terminal based)
- nedit

both have syntax highlighting

sjk 12-13-2003 10:26 PM

I recently discovered the -G option for "ls" in Panther to enable colorized output.

cradom 12-14-2003 10:38 AM

For Panther put this in your .cshrc,

setenv CLICOLOR "true"
setenv LSCOLORS "gxfxcxdxbxegedabagacad"

To find out what all those letters mean after LSCOLORS, man ls.

DMCrimson 12-14-2003 01:08 PM

sjk, cradom: those do not work in panther... tried just a minute ago.

sjk 12-14-2003 04:35 PM

What specifically doesn't work, the -G option to ls (maybe you're running the wrong version) or the setenv commands (won't work in bash)?

What's the output from "which ls" and "echo $TERM" commands?

trinitrotoluene 12-15-2003 07:08 PM

The LSCOLORS works in bash at least. Here's how I have my .bashrc

export LSCOLORS=gxdxcxdxbxegedabagacad
export CLICOLOR=1

DMCrimson 12-19-2003 05:30 PM

lscolors nor -g do not work with LS supplied with panther. Nor does latest fileutils compile without fink -> /sw/bin/ls is the one I'm using now...

sjk 12-19-2003 05:38 PM

It's -G in uppercase, not -g in lowercase. RTFM!

DMCrimson 12-19-2003 06:50 PM

RTFM yourself, tested and verified it IS NOT *****ING WORKING!

ls -G yields colors as it should, but it comes from /sw/bin/

/bin/ls -G ... no colors.


(I do know the difference between CAPITALS and normal letters)

Mods, feel free to eradicate my blabber.

DMCrimson 12-19-2003 06:52 PM

sjk:


RTFM:
Code:

[dmcrimson][dmcrimson]$ man ls | grep G
      -G, --no-group
              print sizes in human readable format (e.g., 1K 234M 2G)
              list numeric UIDs and GIDs instead of names


mervTormel 12-19-2003 06:55 PM

term type
 
easy, boys...

term type can play a factor:
Code:

$ TERM=ansi /bin/ls -G
color doesn't show if term type is vt100, here.

mervTormel 12-19-2003 06:56 PM

Quote:

Originally posted by DMCrimson
RTFM:
Code:

[dmcrimson][dmcrimson]$ man ls | grep G
      -G, --no-group
              print sizes in human readable format (e.g., 1K 234M 2G)
              list numeric UIDs and GIDs instead of names


RT(correct)FM:

that's fink's GNU ls

-G, --no-group
inhibit display of group information


and it has nothing to do with human readable sizes

sjk 12-19-2003 08:10 PM

Re: term type
 
Quote:

Originally posted by mervTormel
term type can play a factor:
Code:

$ TERM=ansi /bin/ls -G
color doesn't show if term type is vt100, here.
Which is why I asked what the output from "echo $TERM" was several days ago yet didn't get a response.

I'm finished here, thanks.

DMCrimson 12-20-2003 09:20 AM

ackackac... sorry sjk... RT (correct) FM is the case:)

but: TERM=ansi /bin/ls -G indeed yields color, although the colors weren't the ones I'm accustomed to...

If only I could install the whole fileutils... without fink, that is:)

mervTormel 12-20-2003 10:26 AM

Quote:

Originally posted by DMCrimson
...If only I could install the whole fileutils... without fink, that is:)
you can. go for it.

DMCrimson 12-20-2003 11:40 AM

as you can see from above... fileutils 4.1 didnt compile... trying coreutils 5 as soon as it's downed:)

mervTormel 12-20-2003 11:48 AM

Quote:

Originally posted by DMCrimson
as you can see from above... fileutils 4.1 didnt compile... trying coreutils 5 as soon as it's downed:)
ah, yeah. heh. missed that.

DMCrimson 12-20-2003 11:59 AM

Code:

In file included from /usr/include/machine/param.h:30,
                from /usr/include/sys/param.h:102,
                from /usr/include/netdb.h:84,
                from canon-host.c:36:
/usr/include/ppc/param.h:98: macro "btodb" requires 2 arguments, but only 1 given
/usr/include/ppc/param.h:100: macro "dbtob" requires 2 arguments, but only 1 given
make[3]: *** [canon-host.o] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
[dmcrimson][coreutils-5.0]$


:/ Grr@Apple for screwing them headers.

mervTormel 12-20-2003 12:14 PM

hmm, make worked here, coreutils-5.0, OSX 10.3.2

DMCrimson 12-20-2003 06:36 PM

10.3.2 here too... my param.h seems clunky:/

mervTormel 12-20-2003 06:51 PM

relevant code
 
Code:

/* bytes to pages */
#define btoc(x) (((unsigned)(x)+(PGOFSET))>>PGSHIFT)
#ifdef __APPLE__
#define  btodb(bytes, devBlockSize)        \
        ((unsigned)(bytes) / devBlockSize)
#define  dbtob(db, devBlockSize)            \
            ((unsigned)(db) * devBlockSize)
#else
#define btodb(bytes)                    /* calculates (bytes / DEV_BSIZE) */ \
        ((unsigned)(bytes) >> DEV_BSHIFT)
#define dbtob(db)                      /* calculates (db * DEV_BSIZE) */ \
        ((unsigned)(db) << DEV_BSHIFT)
#endif


DMCrimson 12-20-2003 08:00 PM

just as it reads in my param.h... did you use anything with ./configure?

mervTormel 12-20-2003 08:23 PM

Quote:

Originally posted by DMCrimson
just as it reads in my param.h... did you use anything with ./configure?
no, nothing

DMCrimson 12-20-2003 08:33 PM

bah, this is driving me nutcase here
well, I just gotta live with fink, then...

DMCrimson 12-21-2003 09:22 AM

HAH!

Problem solved:) commented out line 'source /sw/bin/init.sh' from my .bashrc, also changed
CFLAGS='-no-cpp-precomp' from '-Wno-long-double -no-cpp-precomp'


and now it installed coreutils 5.0.91 :)


All times are GMT -5. The time now is 05:36 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.