Project

General

Profile

Feature #6043

mdb: pipe shell output back into mdb ("! ... !")

Added by David Pacheco over 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2015-07-01
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

MDB lets you pipe the output to a subshell using `!`, as in:

> 1::pid2proc | ::pfiles ! grep -v VNODE | awk '{print $3}' 
ffffff0d468fde00
ffffff0d2c238c80
ffffff0d2c238d80
ffffff0d2c0cc240

Often, you want to send that output back into mdb. You can do that by redirecting to a file and using ::cat:

> 1::pid2proc | ::pfiles ! grep -v VNODE | awk '{print $3}' > foo
> ::cat foo | ::print vnode_t v_path
v_path = 0xffffff0d2c92a768 "/var/run/initpipe" 
v_path = 0xffffff0d2bed6ce0 "/system/contract/process/pbundle" 
v_path = 0xffffff0d2bed6d08 "/system/contract/process/template" 
v_path = 0xffffff0d2bd4dbe8 "/system/contract/process/template" 

But it would be really handy to be able to use a second "!" to send output back into mdb, like so:

> 1::pid2proc | ::pfiles ! grep -v VNODE | awk '{print $3}'  ! ::print vnode_t v_path
v_path = 0xffffff0d2c92a768 "/var/run/initpipe" 
v_path = 0xffffff0d2bed6ce0 "/system/contract/process/pbundle" 
v_path = 0xffffff0d2bed6d08 "/system/contract/process/template" 
v_path = 0xffffff0d2bd4dbe8 "/system/contract/process/template" 

No data to display

Also available in: Atom PDF