Advertisement
JPeterson

bash string

Mar 3rd, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.26 KB | None | 0 0
  1. # log
  2. printf 'text
  3. match
  4. text
  5. match
  6. text
  7. text
  8. '>/tmp/test
  9.  
  10. # print all after first match
  11. sed '0,/match/d' /tmp/test
  12. text
  13. match
  14. text
  15. text
  16.  
  17. # print all after last match?
  18. php -r'$s=file_get_contents("/tmp/test"); echo substr($s, strrpos($s,"match"));'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement