0

I tried to make iverilog command s.t I can run verilog program on my Macbook Air. After few steps for installing the files, the tutorial told me to type:

export PATH=~/bin:/usr/local/iverilog/bin

It worked in terms of iverilog command, i.e, I can compile .v file. However, normal command like ls, man,etc. I guess it is the problem of the PATH of the command sets, which means those normal unix command is not located.

Can someone tell me how to fix it and I dont need to export the PATH everytime?

Qiu
  • 5,651
  • 10
  • 49
  • 56
Rob Ye
  • 63
  • 1
  • 7

1 Answers1

1

You didn't add your paths to the current paths established by the OS. Instead, you replaced it with your paths. This is what you need to do in order to add paths to your PATH variable:

export PATH=$PATH:~/bin:/usr/local/iverilog/bin

The $PATH part is your current PATH value, which is added (concatenated actually) to the list of new paths you want to add. This is turn is assigned to PATH variable.

To make this additions permanent, you may want to add the above line to the end of your .profile file, or .bash_profile (whatever you have in OS X)

You can also do as this: http://architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/

Which says that you can edit the file /etc/paths and add whatever paths you want to add, one per line, then save that file and your added paths are available. In this case, just remember to use absolute paths. That is, paths starting with / . The first one you use: ~/bin is not an aboslute path. You need to convert it to an absolute path. To do this, remember that ~ is a shortcut to your HOME directory: something like /Users/myloginname. Type echo $HOME to find it out.

mcleod_ideafix
  • 11,128
  • 2
  • 24
  • 32