Frontier.sysunishellcommand [was Re: Announce: Frontier
8.0b46]
Samuel Reynolds
sam at spinwardstars.com
Tue Jan 15 10:38:47 PST 2002
>>Maybe what you are attempting involve an interactive session with
>>curl or ncftp,
>
>Thank you for your response; I can also get your examples to work.
>
>What I'm trying is to upload a file using FTP. This is not interactive
>(just a single line command), but it is slighly more complicated than
>the http requests from your post.
>
>sys.unixshellcommand ("curl -T path/to/local/file -u username:password
>ftp://ftp.server.com//path/to/remote/file")
>
>the command executes just fine, but there is never any response back to
>frontier, even when i use invalid login data or unresponding servers. so
>my guess is there are different mechanisms for outputting command line
>reponses; it would be nice if frontier could catch them all...
>
>Thanks again,
>michel benevento
I'm not on MacOS X yet, but it may be that Frontier is
grabbing the console output (stdout) but not the console
error output (stderr). These are two separate streams.
And an error message from your invocation of 'ftp' would
go to stderr, not stdout. (When you're working from the
command line, you see both, because the 'terminal' is
the default destination of both.)
Try redirecting stderr to stdout, by adding
2>&1
to the end of your shell command string. Then you
should be able to parse/display the result (error
message or otherwise).
(That's the proper notation in sh and ksh; I'm not sure
what the equivalent is in csh, and I don't know which
is used in this case.)
It'd be even better if stderr was returned separately
by Frontier, but then the call would have to accept
an error-storage address for you to check. (I have
no idea whether it actually does.) Then you wouldn't
have to try to figure out from the result whether
there was an error or not.
HTH.
- Sam
________________________________________
Samuel Reynolds
Spinward Stars: http://www.spinwardstars.com/
sam at spinwardstars.com
More information about the Frontier-Users
mailing list