Opened 6 years ago

Closed 6 years ago

#43798 closed defect (fixed)

.cshrc - setenv path not in quotes

Reported by: joseph.montibello@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.3.1
Component: base Version: 2.2.1
Keywords: Cc:
Port:

Description (last modified by mf2k (Frank Schima))

Hi,

I'm using macports on Mavericks, with tcsh as my shell. I noticed that upon opening my terminal screen, I was seeing "setenv: Too many arguments." I looked at my .cshrc file and saw this:

# MacPorts Installer addition on 2014-05-22_at_14:46:03: adding an appropriate PATH variable for use with MacPorts.
setenv PATH /opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.

I think this setenv was causing the problem because my local $PATH setting has escaped space characters in it, and the whole thing is enclosed in quotes. I think this problem would be solved if macports would simply wrap its setenv PATH in quotes:

setenv PATH "/opt/local/bin:/opt/local/sbin:$PATH"

Note that I'm not a real programmer so I may not know what I'm talking about, but I thought if I was right this might help someone else.

Thanks for your work on macports!

Change History (4)

comment:1 Changed 6 years ago by joseph.montibello@…

Cc: joseph.montibello@… added

Cc Me!

comment:2 Changed 6 years ago by mf2k (Frank Schima)

Cc: joseph.montibello@… removed
Component: portsbase
Description: modified (diff)

In the future, please use WikiFormatting. As reporter, you do not need to Cc yourself.

comment:3 in reply to:  description Changed 6 years ago by ryandesign (Ryan Schmidt)

Replying to joseph.montibello@…:

I think this setenv was causing the problem because my local $PATH setting has escaped space characters in it, and the whole thing is enclosed in quotes. I think this problem would be solved if macports would simply wrap its setenv PATH in quotes:

You're quite right, we should fix that. It applies not only to PATH but also MANPATH, and not only to tcsh but also bash. We could simply quote all environment variables we set, since there's a function we call to write an environment variable to the shell startup file.

Note that it is somewhat unusual to install programs in paths that contain spaces and then set that in PATH. Particularly, autotools-based build systems will not work when the path contains spaces, and the developers of autotools consider that a user error and not a program bug. So there's a limited set of software that you could install in such a path anyway.

comment:4 Changed 6 years ago by jmroot (Joshua Root)

Milestone: MacPorts 2.3.1
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.