Hi,
Would anyone be able to tell me how I can get TextMate to use zsh as the default instead of bash for running commands?
I've tried adding #!/bin/zsh at the top of commands but that just runs them through bash first and it's altering some of the commands along the way.
Any help is much appreciated.
Iain
On 29 Jul 2010, at 19:29, Iain Barnett wrote:
I've tried adding #!/bin/zsh at the top of commands but that just runs them through bash first and it's altering some of the commands along the way.
That should do it. Can you give a step-by-step of what you tried?
TextMate only use bash if there is no shebang, if there is a shebang, it hands the command to exec().
Thanks for replying.
I've fixed it, but I'm not sure why it didn't originally work with exec().I have a command that straightens curly single quotes,
perl -p -e 's/’/''/g;'
This works with zsh (in the terminal) because I've set the option RC_QUOTE so the double quote within the quotes will become a single one.
I've ended up with this:
perl -p -e 's/’/\047/g;'
which works, but it took me a while to figure. I could've written it straight into perl I suppose, but since the command line options write half the code for me that feels like a poor substitute. Is there no way to make zsh the default?
Regards, Iain
On 29 Jul 2010, at 19:22, Allan Odgaard wrote:
On 29 Jul 2010, at 19:29, Iain Barnett wrote:
I've tried adding #!/bin/zsh at the top of commands but that just runs them through bash first and it's altering some of the commands along the way.
That should do it. Can you give a step-by-step of what you tried?
TextMate only use bash if there is no shebang, if there is a shebang, it hands the command to exec().
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
El 29/07/2010, a las 22:05, Iain Barnett escribió:
've fixed it, but I'm not sure why it didn't originally work with exec().I have a command that straightens curly single quotes,
perl -p -e 's/’/''/g;'
This works with zsh (in the terminal) because I've set the option RC_QUOTE so the double quote within the quotes will become a single one.
Possibly is not working not because it is not using zsh, but because is not using the RC_QUOTE from the user profile. Perhaps if you set it in the Mac OS X Environment.plist, it will be used:
http://developer.apple.com/mac/library/qa/qa2001/qa1067.html
In order to set environment variables for use within applications, you can edit that Environment.plist yourself, or use the RCEnvironment control panel:
http://www.rubicode.com/Software/RCEnvironment/
-- Juande Santander Vela Applied Scientist, Archive Management Group Archive Department, Data Management & Operations Division European Southern Observatory (Germany)
Anónimo: En algún lugar, alguien sueña con tu sonrisa, y cuando está junto a ti piensa que la vida merece la pena. Así que cuando estés a solas, recuerda esta verdad: alguien, en algún lugar, piensa en ti.
On 29 Jul 2010, at 22:05, Iain Barnett wrote:
[...] This works with zsh (in the terminal) because I've set the option RC_QUOTE so the double quote within the quotes will become a single one.
Using zsh as interpreter for scripts does not source the same files as when used as an interactive shell — it is also a bad idea to make commands rely on certain options being set (not portable or robust against system upgrades etc.).
This command works:
#!/bin/zsh setopt RC_QUOTES perl -p -e 's/’/''/g;'
[...] I could've written it straight into perl I suppose, but since the command line options write half the code for me that feels like a poor substitute.
This is the perl version:
#!/usr/bin/perl -p s/’/'/g;
Is there no way to make zsh the default?
As said, you can set it via the shebang :)
Sorry, thought I'd sent this, but I'm obviously either forgetful or rude :) Thanks Allan and Juande for the help, much appreciated.
On 30 Jul 2010, at 08:03, Allan Odgaard wrote:
it is also a bad idea to make commands rely on certain options being set (not portable or robust against system upgrades etc.).
If the Perl command-line options change then Perl6 is out and I'm throwing a party like it's 1999 (or whenever it was scheduled to appear)
:)
Iain