4

Adding paths to PATH using a multi-line syntax

view full story
linux-howto

http://unix.stackexchange.com – As far as I understand, the usual way to add a path to the PATH environment variable is by concatenating paths separated by the : character. For example, if I want to add three paths to it /my/path/1, /my/path/2 and /my/path/3, I would have to do it as follows: PATH=$PATH:/my/path/1:/my/path/2:/my/path/3 which is not easy to read. Is there a way to define or add paths to the PATH variable using a multi-line syntax? Perhaps using arrays? I am looking for something like this: PATH = $PATH /my/path/1 /my/path/2 /my/path/3 In case there are interesting solutions that are shell specific, (HowTos)