[Metacard] RE: shell behavior ( strange or mistake)

thierry Douez t.douez at wanadoo.fr
Sat Nov 24 08:08:00 EST 2001


  | De : metacard-errors at www.runrev.com
  | De la part de xbury.cs at clearstream.com
  | Envoyé : Thursday, November 22, 2001 5:25 PM
  |
  | Thierry,
  |
  | I dont know about alternative shells but... (i use mostly NT
  | so, shell is
  | "cmd" but i've had no problems with command from w98)

I got problems on win98 with the command.exe !!!
but , I admit i'm asking for a lot :-)
What i tried whas to execute a perl script,
where the script is stored as a text in MC.
then just do shell( perl -e & quote & field "Perl" & quote ).
Sure, we have to set properly HOME and PATH directories for the dos.
I got amazing results... 10 lines

  | make sure your "directory" global is set to something that exists...
  | set the directory to "c:\"
  | If the directory is invalid, you will get errors even from
  | working commands.
  |
  | use of backslash or slash within the command shell should be
  | backslash...
  | Slash is only good in MC directory commands (but you can use backslash
  | AFAIK).
  |
  | Scott has told me that the "open process" works better but i've
  | had enormous
  | problems with compatibility and getting the whole output back whereas
  | shell() works great in all senses.
  |
  | With slow network connections, the shell() command can stall completely
  | though. This is really a bad problem because it causes major
  | problems in our
  | environment but for ALL other purposes, it's not a problem.
  |
  | Last but not least, remember that the path will affect the workings of
  | different programs you call from shell or open process, so providing the
  | path can help...
  |
  | shell( "echo $0 $1 $2"  ) worked great first time...
  |
  | here's an example startup script for you
  |
  | on openstack
  |   put the itemdelimiter into olddelim
  |   put the effective filename of the topstack into x
  |   if "/" is in x
  |   then get "/"
  |   else get "\"
  |   set the itemdelimiter to it
  |   delete last item of x
  |   put it after x
  |   set the itemdelimiter to olddelim
  |   set the directory to x
  |
  |   set the shellCommand to "cmd.exe" -- NT only
  |   set hideConsoleWindows to true
  |
  |   put "" into editMenus -- for the mac
  |
  |   CheckToolsAvailable -- dos tools required in the gui for
  | shell commands
  |   CheckUserIsAdmin -- user has the rights to work the tools?
  |   pass openstack
  | end openstack
  |
  | cheers
  | Xavier
  |
  | > Hi all,
  | >
  | > Spend few times trying to play with shell options.
  | > Here is one my smaller program :
  | >
  | >   -- PC /Win98 / MC2.3
  | >   set the hideConsoleWindows to false
  | >   set the shellcommand to "bash"
  | >   put  shell( "echo $0 $1 $2"  ) after field "R"
  | >
  | > I got this error after the Shell() execution :
  | >
  | >   /C: /C: No such file or directory
  | >
  | > It seems that MC put a Dos parameter "/C" after the name of
  | > the shell ? Ok, if the shell is Command.exe ! but, what if we want
  | > another shell ? A bit of light would be helpful.
  | >
  | > Have a nice day,
  | > thierry
  | >
  | > Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
  | > Info: http://www.xworlds.com/metacard/mailinglist.htm
  | > Please send bug reports to <bugs at metacard.com>, not this list.
  | >
  |
  |
  | Visit us at http://www.clearstream.com
  |
  | IMPORTANT MESSAGE
  |
  | Internet communications are not secure and therefore
  | Clearstream International does not accept legal responsibility
  | for the contents of this message.
  |
  | The information contained in this e-mail is confidential and
  | may be legally privileged. It is intended solely for the
  | addressee. If you are not the intended recipient, any
  | disclosure, copying, distribution or any action taken or
  | omitted to be taken in reliance on it, is prohibited and may be
  | unlawful. Any views expressed in this e-mail are those of the
  | individual sender, except where the sender specifically states
  | them to be the views of Clearstream International or of any of
  | its affiliates or subsidiaries.
  |
  | END OF DISCLAIMER
  |
  | Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
  | Info: http://www.xworlds.com/metacard/mailinglist.htm
  | Please send bug reports to <bugs at metacard.com>, not this list.
  |


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <bugs at metacard.com>, not this list.




More information about the metacard mailing list