1

I have meshlab in my Unity Launcher with the following desktop file:

[Desktop Entry]
Version=1.0
Name=MeshLab
Name[en_GB]=MeshLab
GenericName=Mesh processing
GenericName[en_GB]=Mesh processing
Comment=View and process meshes
Type=Application
Exec=meshlab
Icon=/usr/share/pixmaps/meshlab_32x32.xpm
Terminal=false
MimeType=model/mesh;application/x-3ds;image/x-3ds;model/x-ply;application/sla;model/x-quad-object;model/x-geomview-off;application/x-cyclone-ptx;application/x-vmi;application/x-bre;model/vnd.collada+xml;model/openctm;application/x-expe-binary;application/x-expe-ascii;application/x-xyz;application/x-gts;chemical/x-pdb;application/x-tri;application/x-asc;model/x3d+xml;model/x3d+vrml;model/vrml;model/u3d;model/idtf;
Categories=Graphics;3DGraphics;Viewer;Qt;

But I need to run the program with the following command so that it parses the mesh files correctly:

LC_ALL=C meshlab

The documentation says that I can't use a "=" sign in the command but it soesn't say anything on what else to do, if you need one. I tried escaping it with a backslash and putting the whole command or just the first part in double quotes but I couldn't get it to work.

Any help would be greatly appreciated.

0

1 Answer 1

3

Change the line to

Exec=bash -c 'LC_ALL=C meshlab'

This will run the command in quotes in an own bash session, where multiple commands as well as changing environment variables is possible.

7
  • Or you could set LC_ALL and run meshlab in separate commands as follows: LC_ALL=C; meshlab;. Sep 13, 2017 at 15:15
  • 1
    @usmanayubsh You could do that, but what's the point? If there's just one command we don't need to set the variable for other commands. It's not any different in this case, or is it?
    – dessert
    Sep 13, 2017 at 15:17
  • I just want to point out that they are two different commands. Because from what I understand from the post, OP thought "C meshlab" is one value being passed to a variable LC_ALL and that's why exactly he/she also tried double-quotes (and escape sequence). Sep 13, 2017 at 15:22
  • 1
    @usmanayubsh In fact they are not two different commands – it's just meshlab executed with a changed environment variable. You're right about that OP could have tried quoting and escaping the wrong way. We'll never know…
    – dessert
    Sep 13, 2017 at 15:30
  • 2
    @usmanayubsh LC_ALL=C; meshlab; shouldn't be used. It doesn't actually work, unless by coincidence LC_ALL was exported. If LC_ALL is in the caller's environment or export LC_ALL was used, bash passes it into the environment of meshlab. If not, LC_ALL=C as a separate command only sets a shell variable and won't affect any subsequent commands' environments. In contrast, LC_ALL=C meshlab works whether or not LC_ALL was exported and affects just the one command. There's no need to set if for multiple commands here but one correct way is export LC_ALL=C; then the commands. Sep 15, 2017 at 2:01

Not the answer you're looking for? Browse other questions tagged .