I'm just starting to try out TextMate, but a bunch of my commands are failing for what looks like pathing issues.
A simple illustration of the problem is trying to do the 'Execute Line Inserting Result' command on say, 'ls' for example. I get:
ls /bin/bash: line 1: ls: command not found
Trying to do something like 'Filter Through Command...' yields man many lines of '/bin/bash: line 1: dirname: command not found'
It looks like a path issue. I'm using .MacOSX/environment.plist to set my environment path, but /bin, /usr/bin, et all are in there. So I don't see why that would be an issue. The only other funky thing I'm doing is parsing my environment.plist in .profile so I don't have two sources of path information. Again, not sure why that would be an issue, but it's at least related.
This is all on TextMate (trial) Version 1.5.5 (1368)
Any ideas?
Thanks in advance! -Mat
On Jun 8, 2007, at 3:06 PM, Mat Schaffer wrote:
It looks like a path issue. I'm using .MacOSX/environment.plist to set my environment path, but /bin, /usr/bin, et all are in there. So I don't see why that would be an issue. The only other funky thing I'm doing is parsing my environment.plist in .profile so I don't have two sources of path information. Again, not sure why that would be an issue, but it's at least related.
Just to be sure, post your environment.plist.
On Jun 8, 2007, at 10:12 PM, Bryan Liles wrote:
On Jun 8, 2007, at 3:06 PM, Mat Schaffer wrote:
It looks like a path issue. I'm using .MacOSX/environment.plist to set my environment path, but /bin, /usr/bin, et all are in there. So I don't see why that would be an issue. The only other funky thing I'm doing is parsing my environment.plist in .profile so I don't have two sources of path information. Again, not sure why that would be an issue, but it's at least related.
Just to be sure, post your environment.plist.
Sure:
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http:// www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>PATH</key> <string>/opt/grails/bin:/Users/schapht/Library/usr/bin:/usr/ local/php5/bin:/usr/local/bin:/opt/local/bin:/bin:/sbin:/usr/bin:/usr/ sbin:/usr/local/mysql/bin:/usr/sbin:/opt/mtasc:/System/Library/ Frameworks/JavaVM.framework/Libraries/maven/bin</string> </dict> </plist>
On 6/8/07, Mat Schaffer schapht@gmail.com wrote:
The only other funky thing I'm doing is parsing my environment.plist in .profile so I don't have two sources of path information.
I bet this is the problem. TextMate will source your .profile when you run a command, in an attempt to pick up environment information that's set there. Some random thoughts:
1. When you load environment.plist from .profile, do you do so via a relative path? When TextMate sources .profile, the current working directory isn't $HOME. Try explicitly referring to "$HOME/.MacOSX/environment.plist", if you're not doing so already.
2. Failing that, if you temporarily rename .profile so that TextMate can't pick it up, does it start working then?
Robin
On Jun 9, 2007, at 3:46 AM, Robin Houston wrote:
On 6/8/07, Mat Schaffer schapht@gmail.com wrote: The only other funky thing I'm doing is parsing my environment.plist in .profile so I don't have two sources of path information.
I bet this is the problem. TextMate will source your .profile when you run a command, in an attempt to pick up environment information that's set there. Some random thoughts:
Yep, that was totally it. I was referring it .MacOSX not $HOME/.... Does TextMate honor the stuff in environment.plist? If so is there some way I could identify in .profile if I'm being called by TextMate? Maybe I'm just making this too complicated and I should have just two sources of path. But you know, don't-repeat-yourself and what not.
Thanks! Mat
On 6/9/07, Mat Schaffer schapht@gmail.com wrote:
Does TextMate honor the stuff in environment.plist?
Sure it does. When you log in, the values in environment.plist are set, and passed on to all applications that you launch.
If so is there some way I could identify in .profile if I'm being called by
TextMate?
My question would be, why do you need to set the values in .profile as well? All I can think of is that you sometimes ssh into the machine, and you want the environment variables to be set when you log in via ssh. If that's it, and you don't want to redundantly re-parse environment.plist, couldn't you just do
if [ -z "$SSH_CONNECTION" ]; then # parse $HOME/.MacOSX/environment.plist ... fi
Robin
On 6/9/07, Robin Houston robin.houston@gmail.com wrote:
if [ -z "$SSH_CONNECTION" ]; then # parse $HOME/.MacOSX/environment.plist ... fi
I meant -n, not -z. Sorry.
Robin
On Jun 9, 2007, at 12:46 PM, Robin Houston wrote:
My question would be, why do you need to set the values in .profile as well? All I can think of is that you sometimes ssh into the machine, and you want the environment variables to be set when you log in via ssh. If that's it, and you don't want to redundantly re- parse environment.plist, couldn't you just do
Because I assumed that bash didn't honor environment.plist. Turns out it does but the default /etc/profile overrides it. Good job, apple....
Thanks for the SSH tip and sending me down the path of poking at my profile. A slight modification of /etc/profile and all is in order. :)
-Mat