Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • If you wrap your commands and output in triple quotes it makes this much easier to read. Can you edit your question? Commented Oct 28, 2022 at 20:45
  • I tried now is it okay Commented Oct 28, 2022 at 20:55
  • 1
    You can do this with sed if you can write a regular expression for it. I'd need to see more examples of the output to see the patterns. Personally I wouldn't do it in shell or with regular expressions, I'd probably write a simply python script for it. But I can still help if I see more lines. Commented Oct 28, 2022 at 20:59
  • echo mFocusedApp=ActivityRecord{273535b u0 com.any.some/.app.AnyActivity t5595} | cut -d\ -f3 | cut -d/ -f1 yields com.any.some but like I say, more sample output would make for a more robust solution. Commented Oct 28, 2022 at 21:00
  • nearly the same as your other question: unix.stackexchange.com/q/722859/330217 Commented Oct 28, 2022 at 21:56