Re: Two questions regarding command line interface
- To: mathgroup at smc.vnet.net
- Subject: [mg3085] Re: Two questions regarding command line interface
- From: villegas (Robert Villegas)
- Date: Wed, 31 Jan 1996 03:02:49 -0500
- Organization: Wolfram Research, Inc.
- Sender: owner-wri-mathgroup at wri.com
In article <4efbc3$rp7 at dragonfly.wri.com> tlm at ameslab.gov (Tom Marchioro) writes: > 1) For some rather complicated reasons it is often convenient for me to > be sitting at one NeXT and running mathematica in a shell window on the > other. No real problem, but when I want to make a plot there seems to be > no simple way to "display" it back on the first machine, as there is on an > X-windows machine which just reads the DISPLAY environmental variable and > pipes the graphic accordingly. Instead I have to save the plot to a file, > psfix it, and ftp it back to the first machine. Q: Is there some better > way to handle this? Perhaps something I can put in my init.m or some > such. I put the following mechanism into my init.m a long time ago for exactly this purpose, and it seems to work well. I can be logged into NeXT's or other Unix machines and have the graphics displayed in Preview on the machine where I'm sitting. SetRemoteDisplay[hostname_String] := $Display := {$NeXTDisplayMine[hostname]} SetRemoteDisplay[] := $Display := {$NeXTDisplayMine["mylocalhost"]} $NeXTDisplayMine[hostname_String] := ToString @ StringForm["!tmp=$$ ; rsh `1` \"psfix > /tmp/Mathematica_$tmp.`2`.ps\" ; rsh `1` open /tmp/Mathematica_$tmp.`2`.ps", hostname, $Line] I've substituted "mylocalhost" for the actual name of my machine at work; you should put the name of your usual machine there. You could put this in your init.m, and whenever you run a kernel on a remote machine and want to start displaying graphics on your local machine, do SetRemoteDisplay[] If you're at the console of a different NeXT from your usual, say "differenthost", do this: SetRemoteDisplay["differenthost"] If you are almost always at the same console, you could put this in your init.m so you don't have to type a command to set things up every time you run a remote kernel: If[$MachineName != "mylocalhost", SetRemoteDisplay[] ] Speaking of useful interaction between the NeXT OS and the Mathematica kernel, here is a command that I find incredibly useful. expr >> !openfile It pops open a window in Edit and puts the expression in there, instead of displaying it as Out[n] in the kernel's window. After I evaluate this, I can momentarily go to Edit to view the expression in a wide window, scroll through it if it's large, and not have it clutter up my kernel window. The previous few commands in my session are still on the screen, instead of miles above in the scroll buffer, having been displaced by some huge output. You can do it when running a remote kernel, too expr >> "!rsh mylocalhost openfile" but for some reason, you have to do an abort to get the input prompt back. I'm not sure if this is a bug in 'openfile' or in the kernel. Robby Villegas ==== [MESSAGE SEPARATOR] ====