Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] shrink looong pathname in an error message
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3921
Location: Hamburg

PostPosted: Wed Feb 10, 2016 1:28 pm    Post subject: [solved] shrink looong pathname in an error message Reply with quote

For bugzilla I do shrink messages in the following manner:
Code:
$> echo '/var/tmp/portage/net-misc/i2pd-2.4.0/work/i2pd-2.4.0/Signature.h:8:24: fatal error: openssl/ec.h: No such file or directory' | sed -e "s#/.*/#/.../#g"

/.../ec.h: No such file or directory
I'd prefer t rather sth. like this:
Code:
/.../Signature.h:8:24: fatal error: openssl/ec.h: No such file or directory

Any hints ?


Last edited by toralf on Thu Feb 11, 2016 9:15 am; edited 1 time in total
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3105

PostPosted: Wed Feb 10, 2016 4:32 pm    Post subject: Reply with quote

Far from bullet proof, but it still is a bit of improvement:
Code:
sed -e 's#/[^ ]*\(/[^/:]*:\)#/...\1#g'
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3921
Location: Hamburg

PostPosted: Wed Feb 10, 2016 4:53 pm    Post subject: Reply with quote

szatox wrote:
Far from bullet proof, but it still is a bit of improvement:
Code:
sed -e 's#/[^ ]*\(/[^/:]*:\)#/...\1#g'

works.
Thx !
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum