I recently installed the student version of MATLAB on my laptop. I had
ls aliased to ls --color, in order to get color highlighting. In the
matlab command window you get garbage for the colors. example:
EDU>> ls
ans =
[00m[01;33mX11[00m [01;33metc[00m
[01;32minstall_matlab[00m [00mlicense.txt[00m [01;33msys[00m
[01;33mbin[00m [01;33mextern[00m [00minstall_matlab.out[00m
[01;33msimulink[00m [01;33mtoolbox[00m
[01;33mdemos[00m [01;33mhelp[00m [01;33mjava[00m
[01;33mstateflow[00m [01;33mupdate[00m
[m
by removing the alias I am able to get rid of the garbage. I wrote a
small script that I put in my .cshrc file to only set the alias if
Matlab is not running.
set matlab = (`ps xc | grep MATLAB`)
if($matlab[5] != MATLAB) then
alias ls 'ls --color'
setenv LS_COLORS
'no=00:fi=00:di=01;33:ln=01;36:pi=40;34:so=01;35:bd=40;33;01:cd=40;33;01
:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.
lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=0
1;31:*.rpm=01;31:*.jpg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.ppm=0
1;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.png=01;35:*.mpg=0
1;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:'
endif
The problem with this solution is any time that Matlab is running and I
open a new terminal I no longer get the colors.
Is there a smarter way to do this? A way to tell what application the
shell is running in etc.?
Daniel Smith
____________________
BYU Unix Users Group
http://uug.byu.edu/
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
- Re: [uug] C-shell script MATLAB Daniel Smith
- Re: [uug] C-shell script MATLAB Jacob Fugal
