简体   繁体   中英

Linux Export command syntax

What is the difference between these two command lines?

export PATH=/usr/local/something/bin${PATH:+:${PATH}}
export PATH=$PATH:/usr/local/something/bin/

Using Ubuntu 16.04 command shell.

Like larsks said, the difference is based on whether the executable you are adding a PATH to is matched/found first or after the existing PATH you have is exhausted. It will matter if you have two executables named the same thing, or for speed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM