[Magic-dev] ~/.magic breaks UNIX 'file' command on OS X

Philippe Pouliquen philippe at alpha.ece.jhu.edu
Wed May 18 14:33:25 EDT 2005


Hi David,

> I've discovered that a .magic file sitting in one's home directory can 
> break the UNIX 'file' command which is frequently used to check the 
> contents of libraries during compiles/builds.

Yep, this is a known issue.  The work-around is to define an alias for the 
'file' command.  I have the following line in my .bashrc (because I use 
bash as my shell):

alias file="/usr/bin/file -m /usr/share/misc/magic"

You may need to customize the path for your own environment.

Perhaps Tim Edwards could add a "feature" so that Magic looks for .magic 
or .magicrc, that way we wouldn't need to worry about the 'file' command, 
while keeping things backwards compatible.

Philippe Pouliquen
The Johns Hopkins University


More information about the magic-dev mailing list