emacs shell-mode窗口中的prlctl exec问题 [英] Problems with prlctl exec inside emacs shell-mode window

查看:276
本文介绍了emacs shell-mode窗口中的prlctl exec问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问:任何人都可以告诉我如何在emacs shell-mode缓冲区中运行prlctl exec?



---在emacs中的prlctl问题shell模式



我有一台运行在Mac上Parallels上的Windows虚拟机。



我想写一些运行在Mac OS-X
类UNIX环境中的shell和Perl脚本,它在Parallels上调用一个Windows应用程序。
具体的FrameMaker。



具体来说,我想要能够在emacs上运行,在Mac上运行本机
,然后执行esc-x编译运行一个Makefile - 说
Makefile做的事情就像运行FrameMaker ExtendScript命令,
这样做,比如在
FrameMaker中更新一本书的目录,将FrameMaker文件保存为文本或PDF等。基本上,
通常的自动化类型不幸不再那么常见。



我在去年在Windows上使用了Cygwin,但我
切换到使用与Parallels的Mac。



prlctl命令似乎是我需要运行命令。
具体来说,prlctl exec,或者可能是prlctl enter为控制台
类型使用。



PROBLEM:prlctl exec不能很好地运行在Mac上的emacs
下的shell模式缓冲区。



prlctl exec似乎在MacOS终端窗口中运行良好。



但是在emacs shell模式缓冲区中,好的:



a)运行prlctl enter工作一个emacs shell-mode缓冲区。
我可以运行DOS命令行类型命令。但是当我退出
prlctl enter会话时,它总是退出控制shell模式缓冲区的shell。



b)同样,像prlctl exec ...运行在一个emacs
shell-mode缓冲区中,但是当执行的命令终止时,
终止控制shell模式缓冲区的shell。



c)如果我尝试将prlctl exec放在后台,例如(prlctl exec ...&),
事情变得疯狂。什么看起来像键盘控制代码被发送到控制emacs shell模式缓冲区的
shell。



我猜想prlctl是远程控制Windows命令
通过某种假终端拦截。而且它已经通过一个交互式MacOS终端窗口进行了
的测试,但是它并不适用于用于emacs shell模式的伪终端



问:有没有人设法做这样的工作?



说只需从Mac终端窗口运行prlctl exec命令
可能几乎是正确的事情,虽然作为一个emacs本机,
这将是痛苦的,但即使从Mac终端窗口运行,
我得到可能类似的prtlctl的问题。



到目前为止,我还没有能够通过prlctl
启动FrameMaker,尽管我可以通过.BAT文件或PowerShell轻松启动它。



--- + emacs shell缓冲区的prlctl问题示例



--- ++ prlctl在mac终端窗口中成功运行

  Andy-Glew-MacBook -Pro:〜glew $ prlctl list 
UUID状态IP_ADDR NAME
{3b5c5ff5-2909-4a8b-a9e6-a54d909ba98c}运行 - WinVM
Andy-Glew-MacBook-Pro:〜glew $ prlctl进入WinVM
Microsoft Windows [Version 6.3.9600 ]
(c)2013年微软公司。版权所有。

C:\> echo hi
echo hi
hi

C:\> exit
exit
Andy-Glew-MacBook-Pro:〜glew $
Andy-Glew-MacBook-Pro:〜glew $

--- ++ prlctl输入在emacs shell-mode缓冲区中运行

  $ bash glew @ Andy-Glew-MacBook-Pro [〜/ hack] c47 h1222 j0 $ 
$ bash〜/ hack $>
$ bash 1222 $> prlctl进入WinVM
Microsoft Windows [Version 6.3.9600]
(c)2013 Microsoft Corporation。版权所有。

C:\> echo hi
echo hi
hi

C:\> exit
exit
✓02:27:14 PM星期六2015-10-17
$ bash glew @ Andy-Glew-MacBook-Pro [〜/ hack] c48 h1223 j0 $
$ bash〜/ hack $>
$ bash 1223 $>退出

处理shell完成

我在上面输入的退出导致prlctl进入退出,因为它应该 - 但它显然也被发送到emacs shell模式控制进程。



--- ++ prlctl exec在macos终端窗口中

  Andy-Glew-MacBook-Pro:〜glew $ prlctl exec WinVM ipconfig | grep localdomain 
连接特定的DNS后缀。 :localdomain
隧道适配器isatap.localdomain:
连接特定的DNS后缀。 :localdomain
Andy-Glew-MacBook-Pro:〜glew $

可以输入更多命令。我可以在一个脚本中执行多个prlctl execs



---在一个emacs shell模式缓冲区中的++ prlctl exec

  $ bash 1226 $> prlctl exec WinVM ipconfig | grep local 
连接特定的DNS后缀。 :localdomain
链路本地IPv6地址。 。 。 。 。 :fe80 :: 958c:20a3:da02:2903%3
隧道适配器isatap.localdomain:
连接特定的DNS后缀。 :localdomain
链路本地IPv6地址。 。 。 。 。 :fe80 :: 249d:2248:f52c:c8fc%5
✓02:31:43 PM星期六2015-10-17
$ bash glew @ Andy-Glew-MacBook-Pro [〜/ hack] c45 h1227 j0 $
$ bash〜/ hack $>
$ bash 1227 $>退出

处理shell完成

再次,它看起来像一个退出命令由prlctl exec提供给
Windows命令解释器 - 它看起来像prlctl exec
构建在prlctl输入的顶部,并被提供给
Windows命令解释器和emacs shell-mode控制
进程。



--- ++在Mac终端窗口中背景prlctl exec命令 / p>

首先,unbackgrounded:

  Andy-Glew-MacBook-Pro: 〜glew $ prlctl exec WinVM ipconfig | grep localdomain 
连接特定的DNS后缀。 :localdomain
隧道适配器isatap.localdomain:
连接特定的DNS后缀。 :localdomain

然后,背景:

  Andy-Glew-MacBook-Pro:〜glew $ prlctl exec WinVM ipconfig | grep localdomain& 
[1] 63866
Andy-Glew-MacBook-Pro:〜glew $

[1] +停止的prlctl exec WinVM ipconfig | grep localdomain

它挂起一段时间。看起来,即使在MacOS终端
窗口中,prlctl
exec也需要某种类型的控制权限,即使不适用于此命令。

  Andy-Glew-MacBook-Pro:〜glew $ fg 
prlctl exec WinVM ipconfig | grep localdomain

^ C ^ C
^ D
^ ZAndy-Glew-MacBook-Pro:〜glew $
Andy-Glew-MacBook-Pro:〜glew $
Andy-Glew-MacBook-Pro:〜glew $

- ++背景在emacs shell模式缓冲区中的prlctl exec命令



会话文本缩进。



我将注释



首先,我知道最短的prlctl exec命令:

  $ bash glew @ Andy-Glew-MacBook-Pro [〜/ hack] c44 h1226 j0 $ 
$ bash〜/ hack $>
$ bash 1226 $> prlctl exec WinVM echo hi&
[1] 63659
✓02:39:20 PM星期六2015-10-17



在这里暂停了一段时间,但最终僵硬的下面出现 -
它看起来像是prlctl发送一个退出回shell模式。

  $ bash glew @ Andy-Glew-MacBook-Pro [〜/ hack] c45 h1227 j1 $ 
$ bash〜/ hack $>
$ bash 1227 $>退出

处理shell完成

使用更长的命令,如prlctl exec ... ipconfig,出现更多的东西:

  $ bash glew @ Andy-Glew-MacBook-Pro [〜/ hack] c44 h1227 j0 $ 
$ bash〜/ hack $>
$ bash 1227 $> prlctl exec WinVM ipconfig | grep localdomain&
[1] 58231
✓02:36:10 PM星期六2015-10-17

以上是我输入的prlctl exec命令。

  $ bash glew @ Andy-Glew-MacBook-Pro [〜 / hack] c45 h1228 j1 $ 
$ bash〜/ hack $>
$ bash 1228 $>退出
有停止的作业。

[1] +停止的prlctl exec WinVM ipconfig | grep localdomain
✓02:36:10 PM星期六2015-10-17

它暂停了一会儿。然后它看起来像prlctl exec
开始发送垃圾到emacs shell模式控制进程:

 $ code> $ bash glew @ Andy-Glew-MacBook-Pro [〜/ hack] c45 h1229 j1 $ 
$ bash〜/ hack $>
$ bash 1229 $> [2] 58298
✓02:36:10 PM星期六2015-10-17
$ bash glew @ Andy-Glew-MacBook-Pro [〜/ hack] c46 h1230 j2 $
$ bash〜/ hack $>
$ bash 1230 $> bash:他的::命令没有找到
✗02:36:10 PM星期六2015-10-17
$ bash glew @ Andy-Glew-MacBook-Pro [〜/ hack] c47 h1231 j2 $
$ bash〜/ hack $>
$ bash 1231 $> bash:s:command not found
✗02:36:10 PM星期六2015-10-17
$ bash glew @ Andy-Glew-MacBook-Pro [〜/ hack] c48 h1232 j2 $
$ bash〜/ hack $>
$ bash 1232 $> ✗02:36:10 PM星期六2015-10-17
$ bash glew @ Andy-Glew-MacBook-Pro [〜/ hack] c48 h1233 j2 $
$ bash〜/ hack $>
$ bash 1233 $> bash:e:命令未找到

正如他们正在向没有得到的shell发送文本回应(可能是结果f emacs配置),并导致各种打嗝:

  [2] +停止prlctl exec WinVM ipconfig | grep localdomain 
✗02:36:10 PM星期六2015-10-17
$ bash glew @ Andy-Glew-MacBook-Pro [〜/ hack] c49 h1234 j2 $
$ bash〜 / hack $>
$ bash 1234 $> bash:意外错误附近的语法错误`。*'
✗02:36:10 PM星期六2015-10-17
$ bash glew @ Andy-Glew-MacBook-Pro [〜/ hack] c49 h1235 j2 $
$ bash〜/ hack $>
$ bash 1235 $> > > > ✗02:36:10 PM星期六2015-10-17
bash:意外错误附近的语法错误'1'
> > > ✗02:36:10 PM星期六2015-10-17
bash:意外错误附近的语法错误'1'

现在我得到了很多这样的东西...剪辑...

  bash:语法错误附近意外的标记`1'
✗02:36:10 PM星期六2015-10-17
> > > > > > > > > > > > > > > > > > bash:意外错误附近的语法错误`)'
✗02:36:10 PM星期六2015-10-17
bash:!s\21\ ^ KE\332n\216 ^ C \340 ^ C\262 ^ E\223\377\315 ^ D ^ W\236 ^ D\375\236\270 ^ D\325 ^ P ^ [^ \? 376 ^ C\234g000O\205UE\257p:事件未找到
✗02:36:10 PM星期六2015-10-17
[3] 58511
[3]退出127 Q\320 ^ C\3660\307\203\351wk\244
✗02:36:10 PM星期六2015-10-17

...更多相同 - 看起来像控制代码

 ✗02:36:10 PM星期六2015-10-17 
bash:意外错误附近的语法错误`)'
✗02:36:10 PM星期六2015-10-17
bash:意外错误附近的语法错误`&'

处理shell总线错误:10

实际上,我几乎犹豫显示上一行,因为它提示一个shell错误。



---配置信息



MacBook Pro 2014年中期

  $ bash 1229 $> uname -a 
达尔文Andy-Glew-MacBook-Pro.local 14.5.0达尔文内核版本14.5.0:Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9〜1 / RELEASE_X86_64 x86_64

Parallels版本

  $ bash 1230 $> prlctl --version 
prlctl版本10.3.0(29227)rev 0


从Parallels Desktop关于:
版本10.3.0(29227)
(与命令行相同)

Windows版本

 手动编辑systeminfo只保留好位

$ bash 1232 $> prlctl exec WinVM systeminfo

操作系统名称:Microsoft Windows 8.1 Pro
操作系统版本:6.3.9600 N / A Build 9600
操作系统制造商:Microsoft Corporation
操作系统配置:独立工作站
操作系统构建类型:多处理器免费

系统启动时间:10/17/15,1:56:38 PM
系统制造商:Parallels Software International Inc.
系统型号:Parallels虚拟平台
系统类型:基于x64的PC
处理器:1个处理器已安装。
[01]:Intel64 Family 6 Model 70 Stepping 1 GenuineIntel〜2793 Mhz
BIOS版本:Parallels Software International Inc. 10.3.0(29227)rev 0,9/21/15

总物理内存:12,272 MB
可用物理内存:8,753 MB
虚拟内存:最大大小:14,128 MB
虚拟内存:可用:10,808 MB
虚拟内存:使用:3,320 MB
$ bash glew @ Andy-Glew-MacBook-Pro [〜/ hack] c47 h1233 j0 $
$ bash〜/ hack $>
$ bash 1233 $>退出

处理shell完成

,和往常一样,prlctl exec关闭我在
中运行的emacs shell模式缓冲区
/ pre>

(emacs-version)

  GNU Emacs 24.4。 2015-01-17在Andys-MacBook-Pro.local上的1(x86_64-apple-darwin14.0.0,NS apple-appkit-1343.16)


解决方案

为了在后台运行Parallels exec,我发现了两种不同的方法:



将空发送给STDIN,您的命令不提供输出。参见示例:

  prlctl exec'Windows XP'/temp/script.bat argument1> NUL< / dev / null& ; 

使用xargs在不同的shell中执行每个prlctl命令,您可以在其中定义最大数量同时进程:

  echo var1 var2 var3 | xargs -I {} -P 4 bash -cprlctl exec'Windows XP'/temp/script.bat argument1> NUL

看到这个工作示例(在Linux和Mac上工作):

  seq 10 | xargs -I {} -P 4 bash -cecho start {}; sleep 3; echo done {}

我希望这有助于


Q: can anyone tell me how to run "prlctl exec" in an emacs shell-mode buffer?

---+ prlctl problems in emacs shell mode

I have a Windows virtual machine running on top of Parallels on a Mac.

I want to write some shell and Perl scripts that run on the Mac's OS-X UNIX-like environment, which invoke a Windows app on Parallels. Specifically FrameMaker.

Specifically, I want to be able to work in emacs, running native on the Mac, and then do esc-x compile to run a Makefile - said Makefile doing things like running FrameMaker ExtendScript commands, to do things like update the table of contents of a book in FrameMaker, save the FrameMaker files as text or PDF, etc. Basically, the usual sorts of automation that are unfortunately no longer so common.

I had this all working using Cygwin on Windows last year, but I switched to using a Mac with Parallels.

The prlctl command seems to be what I need to run a command. Specifically, "prlctl exec", or possibly "prlctl enter" for console type usage.

PROBLEM: prlctl exec does not run well in a shell-mode buffer under emacs on the Mac.

prlctl exec seems to run okay in a MacOS terminal window.

But in an emacs shell-mode buffer, well:

a) Running "prlctl enter" works an an emacs shell-mode buffer works. I can run DOS command-line type commands. But when I exit the "prlctl enter" session, it always exits the shell controlling the shell mode buffer.

b) Similarly, commands like "prlctl exec ..." run in an emacs shell-mode buffer, but when the exec'ed command terminates, it terminates the shell controlling the shell-mode buffer.

c) If I try to put the prlctl exec in the background, e.g. (prlctl exec ... &), things go crazy. What looks like keyboard control codes get sent to the shell controlling the emacs shell-mode buffer.

I conjecture that "prlctl" is remote controlling the Windows commands via some sort of pseudoterminal interception. And that it has been tested with an interactive MacOS terminal window, but it does not work with the pseudoterminals used for emacs shell-mode.

Q: has anyone managed to make something like thus work?

Saying "Just run the prlctl exec command from a Mac terminal window might almost be the right thing to do, although as an emacs native, it would be painful. But even when running from a Mac terminal window, I get problems with prtlctl that may be similar.

So far I have not been able to start FrameMaker up at all via prlctl, although I can easily start it up via a .BAT file or via PowerShell.

---+ Example of prlctl problem with emacs shell buffers

---++ prlctl enter running successfully in a mac terminal window

   Andy-Glew-MacBook-Pro:~ glew$ prlctl list
    UUID                                    STATUS       IP_ADDR         NAME
    {3b5c5ff5-2909-4a8b-a9e6-a54d909ba98c}  running      -               WinVM
    Andy-Glew-MacBook-Pro:~ glew$ prlctl enter WinVM
    Microsoft Windows [Version 6.3.9600]
    (c) 2013 Microsoft Corporation. All rights reserved.

    C:\>echo hi
    echo hi
    hi

    C:\>exit
    exit
    Andy-Glew-MacBook-Pro:~ glew$ 
    Andy-Glew-MacBook-Pro:~ glew$ 

---++ prlctl enter running in an emacs shell-mode buffer

$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c47  h1222 j0 $
$ bash  ~/hack $>
$ bash 1222 $>  prlctl enter WinVM
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\>echo hi
echo hi
hi

C:\>exit
exit
✓ 02:27:14 PM Saturday 2015-10-17
$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c48  h1223 j0 $
$ bash  ~/hack $>
$ bash 1223 $>  exit

Process shell finished

The "exit" I typed in above caused the prlctl enter to exit, as it should - but it apparently also got sent to the emacs shell-mode controlling process.

---++ prlctl exec in a macos terminal window

Andy-Glew-MacBook-Pro:~ glew$ prlctl exec WinVM ipconfig | grep localdomain
   Connection-specific DNS Suffix  . : localdomain
Tunnel adapter isatap.localdomain:
   Connection-specific DNS Suffix  . : localdomain
Andy-Glew-MacBook-Pro:~ glew$ 

This works, I can type in more commands. And I can execute multiple prlctl execs in a script

---++ prlctl exec in an emacs shell-mode buffer

$ bash 1226 $>  prlctl exec WinVM ipconfig | grep local
   Connection-specific DNS Suffix  . : localdomain
   Link-local IPv6 Address . . . . . : fe80::958c:20a3:da02:2903%3
Tunnel adapter isatap.localdomain:
   Connection-specific DNS Suffix  . : localdomain
   Link-local IPv6 Address . . . . . : fe80::249d:2248:f52c:c8fc%5
✓ 02:31:43 PM Saturday 2015-10-17
$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c45  h1227 j0 $
$ bash  ~/hack $>
$ bash 1227 $>  exit

Process shell finished

Again, it looks like an "exit" command is being supplied to the Windows command interpreter by prlctl exec - it looks like prlctl exec is built on top of prlctl enter - and is being supplied to both the Windows command interpreter and to the emacs shell-mode controlling process.

---++ Backgrounding a prlctl exec command in a Mac terminal window

First, unbackgrounded:

Andy-Glew-MacBook-Pro:~ glew$ prlctl exec WinVM ipconfig | grep localdomain 
   Connection-specific DNS Suffix  . : localdomain
Tunnel adapter isatap.localdomain:
   Connection-specific DNS Suffix  . : localdomain

Then, backgrounded:

Andy-Glew-MacBook-Pro:~ glew$ prlctl exec WinVM ipconfig | grep localdomain &
[1] 63866
Andy-Glew-MacBook-Pro:~ glew$ 

[1]+  Stopped                 prlctl exec WinVM ipconfig | grep localdomain

It hangs hre for a while. It appears that, even in a MacOS terminal window, some sort of contrlling tty access is required by prlctl exec - even though it should not be for this command.

Andy-Glew-MacBook-Pro:~ glew$ fg
prlctl exec WinVM ipconfig | grep localdomain

^C^C
^D
^ZAndy-Glew-MacBook-Pro:~ glew$ 
Andy-Glew-MacBook-Pro:~ glew$ 
Andy-Glew-MacBook-Pro:~ glew$ 

---++ Backgrounding a prlctl exec command in an emacs shell-mode buffer

The session text is indented.

I will annotate

First, the shortest prlctl exec command I know:

$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c44  h1226 j0 $
$ bash  ~/hack $>
$ bash 1226 $>  prlctl exec WinVM echo hi &
[1] 63659
✓ 02:39:20 PM Saturday 2015-10-17

It paused here for a while, but eventually the stiff below appeared - it looks like prlctl is sending an "exit" back to the shell mode.

$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c45  h1227 j1 $
$ bash  ~/hack $>
$ bash 1227 $>  exit

Process shell finished

With a longer command, like "prlctl exec ... ipconfig", more stuff appears:

$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c44  h1227 j0 $
$ bash  ~/hack $>
$ bash 1227 $>  prlctl exec WinVM ipconfig | grep localdomain &
[1] 58231
✓ 02:36:10 PM Saturday 2015-10-17

Above is the prlctl exec command I entered.

$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c45  h1228 j1 $
$ bash  ~/hack $>
$ bash 1228 $>  exit
There are stopped jobs.

[1]+  Stopped                 prlctl exec WinVM ipconfig | grep localdomain
✓ 02:36:10 PM Saturday 2015-10-17

OK, it paused here for a while. And then it looks like prlctl exec starts sending crap to the emacs shell-mode controlling process:

$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c45  h1229 j1 $
$ bash  ~/hack $>
$ bash 1229 $>  [2] 58298
✓ 02:36:10 PM Saturday 2015-10-17
$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c46  h1230 j2 $
$ bash  ~/hack $>
$ bash 1230 $>  bash: his:: command not found
✗ 02:36:10 PM Saturday 2015-10-17
$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c47  h1231 j2 $
$ bash  ~/hack $>
$ bash 1231 $>  bash: s: command not found
✗ 02:36:10 PM Saturday 2015-10-17
$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c48  h1232 j2 $
$ bash  ~/hack $>
$ bash 1232 $>  ✗ 02:36:10 PM Saturday 2015-10-17
$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c48  h1233 j2 $
$ bash  ~/hack $>
$ bash 1233 $>  bash: e: command not found

It is like they are sending text to the shell that is not getting echoed (probably a result f emacs configuration), and causing various hiccups:

[2]+  Stopped                 prlctl exec WinVM ipconfig | grep localdomain
✗ 02:36:10 PM Saturday 2015-10-17
$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c49  h1234 j2 $
$ bash  ~/hack $>
$ bash 1234 $>  bash: syntax error near unexpected token `.*'
✗ 02:36:10 PM Saturday 2015-10-17
$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c49  h1235 j2 $
$ bash  ~/hack $>
$ bash 1235 $>  > > > ✗ 02:36:10 PM Saturday 2015-10-17
bash: syntax error near unexpected token `1'
  > > > ✗ 02:36:10 PM Saturday 2015-10-17
bash: syntax error near unexpected token `1'

Now I get a lot of this stuff... snipping ...

bash: syntax error near unexpected token `1'
✗ 02:36:10 PM Saturday 2015-10-17
> > > > > > > > > > > > > > > > > > bash: syntax error near unexpected token `)'
✗ 02:36:10 PM Saturday 2015-10-17
bash: !s\21\^KE\332n\216^C\340^C\262^E\223\377\315^D^W\236^D\375\236\270^D\325^P^[^?\376^C\234g000O\205UE\257p: event not found
✗ 02:36:10 PM Saturday 2015-10-17
[3] 58511
[3]   Exit 127                Q\320^C\3660\307\203\351wk\244
✗ 02:36:10 PM Saturday 2015-10-17

... lots more of the same - looks like control codes

✗ 02:36:10 PM Saturday 2015-10-17
bash: syntax error near unexpected token `)'
✗ 02:36:10 PM Saturday 2015-10-17
bash: syntax error near unexpected token `&'

Process shell bus error: 10

Actually, I almost hesitate to show the previous line, since it suggests a shell bug.

---+ Config Info

MacBook Pro mid 2014

$ bash 1229 $>  uname -a
Darwin Andy-Glew-MacBook-Pro.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64

Parallels version

$ bash 1230 $>  prlctl --version
prlctl version 10.3.0 (29227) rev 0


From the Parallels Desktop about:
Version 10.3.0 (29227)
(same as for the command line)

Windows Version

Manually editing systeminfo to keep only the good bits

$ bash 1232 $>  prlctl exec WinVM systeminfo

OS Name:                   Microsoft Windows 8.1 Pro
OS Version:                6.3.9600 N/A Build 9600
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free

System Boot Time:          10/17/15, 1:56:38 PM
System Manufacturer:       Parallels Software International Inc.
System Model:              Parallels Virtual Platform
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
               [01]: Intel64 Family 6 Model 70 Stepping 1 GenuineIntel ~2793 Mhz
BIOS Version:              Parallels Software International Inc. 10.3.0 (29227) rev 0, 9/21/15

Total Physical Memory:     12,272 MB
Available Physical Memory: 8,753 MB
Virtual Memory: Max Size:  14,128 MB
Virtual Memory: Available: 10,808 MB
Virtual Memory: In Use:    3,320 MB
$ bash glew@Andy-Glew-MacBook-Pro [~/hack]  c47  h1233 j0 $
$ bash  ~/hack $>
$ bash 1233 $>  exit

Process shell finished

and, as usual, prlctl exec closes the emacs shell-mode buffer I ran in in

(emacs-version)

GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.16) of 2015-01-17 on Andys-MacBook-Pro.local

解决方案

In order to run a Parallels exec in background, I've found 2 different ways of doing that:

Sending null to STDIN and your command should provide no output. See the example:

prlctl exec 'Windows XP' /temp/script.bat argument1>NUL </dev/null &

Executing each prlctl command in a different shell using xargs, where you can define maximum number of simultaneous process:

echo var1 var2 var3 | xargs -I{} -P 4 bash -c "prlctl exec 'Windows XP' /temp/script.bat argument1>NUL"

See this working example (works on Linux and Mac):

seq 10 | xargs -I{} -P 4 bash -c "echo start {}; sleep 3; echo done {}"

I hope this helps

这篇关于emacs shell-mode窗口中的prlctl exec问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆