comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Test if a linux command is available with Spawn
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Test if a linux command is available with Spawn [message #86195 is a reply to message #86171] Thu, 17 October 2013 05:56 Go to previous messageGo to previous message
Carsten Lechte is currently offline  Carsten Lechte
Messages: 124
Registered: August 2006
Senior Member
On 16/10/13 14:08, Fabien wrote:
> Is there a "more general way" to do this?

I would do it this way:

IDL> spawn, 'ls awoiefsdkf 2>&1 ', asdf
IDL> print, asdf
ls: cannot access awoiefsdkf: No such file or directory

This forces the STDERR output into the STDOUT output. It works regardless of
if and what the command chooses to print where.

Please note that I only said the I would do it this way, not that it is an
elegent way of doing this.

Anyway, I thought this should be pretty general. Then I remembered that shells
other than bash exist. So, one would have to do both bash and csh versions. Or
force /bin/bash. Sorry.


chl
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: NaN problem in integer arrays
Next Topic: Where does catalyst call the catEventDispatcher?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Mon Dec 01 05:06:43 PST 2025

Total time taken to generate the page: 0.72382 seconds