Grep behind can take command?

I want to grep a shell command out of the results
For example
ss=$(tty | sed `s/.*tty//g`)
ss=w | grep $ss
Can these two words in a sentence?

Started by Van at December 03, 2016 - 8:01 AM

w | grep "$(tty | sed 's/.*tty//g')"

Posted by Harlan at December 13, 2016 - 8:37 AM

Brother, grammatically correct, but did not achieve the function of ah, as shown in Fig.: s.JPG
Finally, should only appear
p1 sss

Posted by Van at December 17, 2016 - 9:12 AM

All print out and have a look

Posted by Harlan at December 23, 2016 - 9:55 AM

All print ah, the first sentence is not right? cat cs

Posted by Van at January 05, 2017 - 11:13 AM

tty | sed 's/.*tty//g'This sentence? What is it

Posted by Harlan at January 06, 2017 - 10:14 AM

The result is P1 ah, the picture is not there, said P1 command not found...... Results the /dev/ttyp1, TTY, sed is only P1, and want to find a line that has P1 in the result of W

Posted by Van at January 08, 2017 - 10:57 AM