How to get tcl script to "run"

View: New views
3 Messages — Rating Filter:   Alert me  

How to get tcl script to "run"

by Lists :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I use TM to frame out basic shell scripts all the time, mostly working  
in bash.

I have this
#!/opt/local/bin/tclsh
puts "start of my tcl script"
set lst {{item 1} {item 2} {item 3}}

What bundle item do I need to unfilter out in order to get "Run" to  
work on this?  Currently I use "Shell Script".

I can end the script in .shell and that does it, but I never have had  
to do that with other bash scripts, I just set #!/bin/bash and I am  
usually good to go.  Why is setting of my shebang to #!/opt/local/bin/
tclsh not kicking TM into the correct scope?

Thanks.
--
Scott * If you contact me off list replace talklists@ with scott@ *


_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: How to get tcl script to "run"

by Alex Ross-9 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey Scott,

There is already a “Run” command in the TCL bundle.  That's  
probably the one you want to use.  To get TextMate to recognize a TCL  
script by the #! line, you need to add a “firstLineMatch” rule to  
the grammar.  For instance, the shell script grammar has this  
firstLineMatch:

> firstLineMatch = '^#!.*(bash|zsh|sh|tcsh)';

You could add a similar first line match to the TCL grammar:

> firstLineMatch = '^#!.*(tclsh)';


—Alex


_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: How to get tcl script to "run"

by Michael Sheets-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Nov 4, 2009, at 5:08 PM, Alex Ross wrote:

> You could add a similar first line match to the TCL grammar:
>
>> firstLineMatch = '^#!.*(tclsh)';

Committed this change to the Tcl grammar last night. :)

_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate