Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
linux:sed [2018/05/25 13:05]
127.0.0.1 external edit
linux:sed [2019/01/30 14:35] (current)
preb
Line 5: Line 5:
 <​code>​ <​code>​
 echo "​hadoop-client - 2.3.2.0-2950"​ | sed '​s/​hadoop-client - \([0-9]\.[0-9]\).*/​\1/'​ echo "​hadoop-client - 2.3.2.0-2950"​ | sed '​s/​hadoop-client - \([0-9]\.[0-9]\).*/​\1/'​
 +</​code>​
 +
 +Extract only the IP from a string. \\
 +To do this there must be a start and end character. \\
 +For example ​  "​node1 =192.168.1.50:​5443 hostname" ​  will have a start character of "​="​ and end is ":"​. \\
 +
 +<​code>​
 +sed '​s/​.*\/​\(.*\):​.*/​\1/'​
 </​code>​ </​code>​
  • linux/sed.txt
  • Last modified: 2019/01/30 14:35
  • by preb