English 中文(简体)
如何避免与向间谍程序发送的数据相匹配
原标题:How to avoid matching with the data sent to the spawned process

在我所期望的文字中,下面的密码样本给我带来了许多麻烦。

#!/usr/bin/expect
#some other code
set psucommand "psu |grep -v grep | grep $jobname
"
#some other code
expect "env[lindex $argv 0]>" {send $psucommand}
expect {
"$jobname" {
        send_user "$jobname"
        send "exit
"}
"env[lindex $argv 0]>" {
        send_user ""
        send "exit
"}
}

第二次“投机”试图(成功)与实际的保费相匹配(psu ́grep -v grep ACTUALJOBNAME )。 我派去了间谍工作,我只需要随便的流程产出。

这里我想到的是,当我按预期管理这一文字时,我会看到:d

expect: does " psu |grep -v grep | grep ACTUALJOBNAME
" (spawn_id exp6) match glob pattern "ACTUALJOBNAME"? yes

它把我派出的指挥与间谍工作相匹配。 我需要避免这种情况。

帮助!

最佳回答
set psucommand [format {psu | grep [%s]%s} 
                   [string index $jobname 0] 
                   [string range $jobname 1 end]]

由此可见<条码>psucommand >。

因此,你需要<代码>,以“psucommand”为准,但期望以“现名”计算,不应取而代之。

问题回答

暂无回答




相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

热门标签