jed-users mailing list

[2005 Date Index] [2005 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

system and shell redirect


Dear Jed Users,

the system() function calls a system command and returns the return status.
Nice.

  if (0 == system("which jed"))
     message("jed installed");
  
The output of the system command goes "upstream", no problem in xjed, but
jed in an xterm gets messed up. In jed <= 99.16 it was possible to use

  system("which jed >& /dev/null");
  
to do away with the output. Now (Jed Version: B0.99.17-111
S-Lang Version: 2.0.4) the return value of this command with shell redirect
is 512.

Could someone tell me the reason for this change and maybe propose a
workaround?

The user case is a function to set a custom variable for auxiliary programs in
jedmodes.sf.net/mode/browse_url/

 define find_program(programs)
 {
    variable program, file;
    foreach (strchop(programs, ',', 0))
      {
 	program=(strtrim());
 	!if(system(sprintf("which %s >& /dev/null",   
                           extract_element(program, 0, ' '))) 
           )
 	  return program;
      }
    return "";
 }


Thanks

Guenter Milde





-- 
G.Milde web.de

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2005 date index] [2005 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]