[PD] [shell] on OSX...
IOhannes m zmoelnig
zmoelnig at iem.at
Thu Oct 18 17:34:34 CEST 2007
Derek Holzer wrote:
> ...is painfully slow! It takes minutes sometimes to execute a command
> that the terminal handles is a second or two. Why is that? Does anyone
> else have this problem?
i cannot help you here, but most likely it is a problem with
initializing a context:
everytime you call shell, it will have to restart the shell-interpreter
which will take some time (when you start the terminal it also takes
some time...once the terminal is up and running it is faster, but you
don't get this with the [shell])
btw, this is the reasons why many often-used applications are often
re-written as daemons (e.g. i have a virus-scanner that usually get's
called from the cmdline to scan a file - this is too slow if you are
using it on a mailserver; therefore there is a daemonized version of the
scanner which is always running and which takes the data to be scanned
via a pipe)
this is also one of the reasons i hardly ever use [shell] but usually
write a small shellscript server (using ./pdreceive) and send data to
this server via [netsend] (and vice versa)
i often find this more stable (and fun), but it is more complicated to
setup.
> Also, it doesn't seem to understand, for example
> "cd /home/derek", since a "pwd" command immediately after still lists
> "/" as the current dir.
what makes you think it doesn't understand?
whenever you call shell, it will open up a new context.
so when you send "cd /home/derek" it will changedir into /home/derek
(from /) and then quit. when you call "pwd" it will print the working
directory of a fresh context (which is /)
it is like when you open a terminal and do a "cd /usr/local" and then
open another terminal and do a "pwd"...
this behaviour is the same on all platforms.
therefore you one usually uses scripts for more complex operations:
$ cat /tmp/doit.sh
#!/bin/sh
cd /home/derek
pwd
and then do
[/tmp/doit.sh(
|
[shell]
fmadsr.
IOhannes
More information about the Pd-list
mailing list