linux - Getting a specifit string from a text using bash -



linux - Getting a specifit string from a text using bash -

i have output this:

tag: abrodov_linux_vlsi07_test1 global path: /net/vposeidon02/vlsifs/vlsi02/vlsi_ccstore/07/abrodov/abrodov_linux_vlsi07_test1.vws server host: ta1vlsi07 region: tlv_unix active: yes view tag uuid:26075e8c.4e2e11e4.9cc0.a4:ba:db:3c:fc:0e view on host: ta1vlsi07 view server access path: /net/vposeidon02/vlsifs/vlsi02/vlsi_ccstore/07/abrodov/abrodov_linux_vlsi07_test1.vws view uuid: 26075e8c.4e2e11e4.9cc0.a4:ba:db:3c:fc:0e view owner: abrodov

i need th server host in illustration ta1vlsi07

i wrote command worked in order view uuid, in case didn't work, here command:

ct lsview -l abrodov_linux_vlsi07_test1 |grep -i 'server host:' | cutting -d" " -f3

the output server instead of host name.

you in single grep command if supports -p parameter.

ct lsview -l abrodov_linux_vlsi07_test1 | grep -op 'server host:\s*\k\s+'

explanation:

server host: matches string server host: \s* matches 0 or more spaces. \k discards matched characters getting printed. in our case server host: plus next spaces got discarded. \s+ next 1 or more non-space characters matched , printed out.

linux bash unix clearcase

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -