[GRASS-dev] Re: return of the OSX xterm question

Michael Barton michael.barton at asu.edu
Mon Apr 9 02:26:24 EDT 2007


I'll give this a try tomorrow. I don't know the answer to the question about
running a command without command output. But I'd like to know for the
wxPython GUI.

Cheers
Michael


On 4/8/07 4:41 PM, "William Kyngesburye" <woklist at kyngchaos.com> wrote:

> Messing around today, and I recalled the discussion about how to get
> grass-xterm-wrapper to use an OSX Terminal.  I think I figured out
> something that could work.  Combining Lorenzo's AppleScript sample
> and Glynn's way to strip the command out of the parameters and a
> little experimentation, I have a relatively simple script to do this.
> 
> Though simple - it's all handled in grass-xterm-wrapper, so there is
> no need to rewrite scripts - it's a bit of a messy AppleScript hack.
> 
> The main problem I couldn't fix is that the AppleScript command to
> run a shell script in the Terminal chokes on large command strings (1
> byte over 1K), and a large string is needed to pass the env vars to
> the Terminal.  So I pass them in byte-sized (hee hee) pieces, and
> there is the potential that the user can interrupt this by switching
> to another Terminal window.
> 
> But it's fast enough that it shouldn't be a serious problem.
> 
> To test this, replace lib/init/grass-xterm-wrapper with this one and
> rebuild GRASS, or replace the installed grass/etc/grass-xterm-
> wrapper.  Before running GRASS, set GRASS_XTERM=Terminal.app in your
> ~/.bash_profile.
> 
> 
> I tested it in the Tcl GUI startup mapset screen, choosing New
> Location by Projection Values.
> 
> 
> One thing I'm wondering - is there a way to run a command in a shell
> script without displaying the command in the shell?  Something like
> the @ prefix used in makefiles?  Since I have to recreate the env
> vars in the new Terminal window, a lot of stuff is spewed to the user
> before the requested command is actually run.
> 
> -----
> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
> http://www.kyngchaos.com/
> 
> "History is an illusion caused by the passage of time, and time is an
> illusion caused by the passage of history."
> 
> - Hitchhiker's Guide to the Galaxy
> 
> 

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton





More information about the grass-dev mailing list