add a generic function to test libmagic version
fix command line escaping for arguments containing spaces