0

I have installed VMware ovftool using the regular installer, which installed it in the /Application folder. I now want this added to the global path, so I added it to /etc/paths, see following output:

➜  ~ cat /etc/paths
/Applications/VMware\ OVF\ Tool
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

➜  ~ ls /Applications/VMware\ OVF\ Tool
README.txt               lib                      vmware-eula.rtf
certs                    open_source_licenses.txt vmware.eula
env                      ovftool
icudt44l.dat             schemas

Still the command is not found when trying to execute it, but the path variable is set correctly:

➜  ~ ovftool
zsh: command not found: ovftool

➜  ~ echo $PATH
/Applications/VMware\ OVF\ Tool:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/MacGPG2/bin

How to correctly make ovftool available?


Edit based on the (not working) answer below:

➜  ~ echo $PATH
"/Applications/VMware OVF Tool":/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/MacGPG2/bin

➜  ~ ovftool
zsh: command not found: ovftool

➜  ~ echo $PATH
"/Applications/VMware\ OVF\ Tool":/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/MacGPG2/bin

➜  ~ ovftool
zsh: command not found: ovftool

Edit 2:

Wrapping the entire path in quotes and exporting it again works:

➜  ~ export PATH="/Applications/VMware OVF Tool:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/MacGPG2/bin" 
➜  ~ ovftool
Error: No source or target specified. Try 'ovftool --help' for more options.
Completed with errors

How do I do that in /etc/paths though?

3 Answers 3

0

Am alternative is create a file in /etc/paths.d

In that file just include the directory needed with no inverted commas or escaping needed.

0

Turns out that for /etc/paths whitespaces are OK and must not be escaped. Adding the following line to the file works perfectly fine:

# cat /etc/paths
/Applications/VMware OVF Tool
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

Sometimes its the simple things that work...

-1

The problem are the spaces in the path. You have to add it in quotes -> “/Applications/VMware\ OVF\ Tool”

1
  • I have escaped the whitespaces but now also tried it without quotes and without quotes, both doesn't work.
    – Daniel
    Commented May 25, 2021 at 11:19

You must log in to answer this question.

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