本帖最后由 274920831 于 2018-07-13 11:33 编辑
当我使用这个命令时 ipptool -tv -I -d "doc-uri=http://www.nice.com/123.txt"
有如下输出: media-col (collection) = {media-source=auto}
job-uri (uri) = ipp://192.168.0.1/ipp/print/job-0030
job-id (integer) = 30
job-state (enum) = processing
job-state-reasons (keyword) = none
STATUS = server-error-busy (server-error-busy)
我在stackflow上提出问题:如何取到job-id的值 30 。 他们给出的回复是:
Using Select-String:
$ipptool = $(ipptool -tv -I -d "doc-uri=http://www.nice.com/123.txt")
[Int]($ipptool | Select-String "job-id \(integer\) =\s*(\d+)").Matches.Groups[1].Value
那如果现在我想取server-error-busy ,这个server-error-busy是这一行
STATUS = server-error-busy (server-error-busy)
的 = 号后面的server-error-busy,使用什么方法可以取到这个值?
|