What is the difference between spawn and exec?

后端 未结 4 1477
-上瘾入骨i
-上瘾入骨i 2021-02-04 01:50

I\'m learning to write a TCL (expect) scripts and I notice that some examples show to use spawn, while others show the command exec. I tried googling, but can\'t find what is th

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-04 01:54

    As far as I know, spawn returns a process ID (and links in with Expect), while exec just returns the final stdout, unless you pass "&". So it won't affect your expects.

提交回复
热议问题