Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Accidentally removed /bin/env
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
b-lion
n00b
n00b


Joined: 01 Oct 2012
Posts: 2

PostPosted: Mon Oct 01, 2012 7:48 am    Post subject: Accidentally removed /bin/env Reply with quote

.

Last edited by b-lion on Sun Apr 21, 2013 7:40 am; edited 1 time in total
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 2404
Location: UK

PostPosted: Mon Oct 01, 2012 9:18 am    Post subject: Reply with quote

Code:
cp /bin/busybox /bin/env
emerge -1 coreutils
Back to top
View user's profile Send private message
fb0x
n00b
n00b


Joined: 13 Sep 2012
Posts: 11

PostPosted: Mon Oct 01, 2012 9:18 am    Post subject: Reply with quote

Reinstall coreutils ?
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1159

PostPosted: Mon Oct 01, 2012 10:08 am    Post subject: Reply with quote

list of atoms:
# grep -r -e'^obj /etc/env' /var/db/pkg/**/**/CONTENTS|sed -e's:/CONTENTS.*::' -e's:/.*/::'|sort -u

RTFM for more:
# man grep sed sort find

[edit]I was blind and red /etc/env. Excuse me!
(
And my was not correct:
grep -l -r -e'^obj /etc/env' /var/db/pkg/**/**/CONTENTS|sed -e's:/CONTENTS.*::' -e's:/.*/\(.*/\):=\1:'
Yes khayyam with awk is nicer:
grep -l -r -e'^obj /etc/env' /var/db/pkg/**/**/CONTENTS| awk -F/ '{print "=" $5 "/" $6}'
but even shorter!
)
_________________
fun2gen2


Last edited by ulenrich on Mon Oct 01, 2012 11:35 pm; edited 4 times in total
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2244

PostPosted: Mon Oct 01, 2012 9:07 pm    Post subject: Reply with quote

ulenrich wrote:
list of atoms:
# grep -r -e'^obj /etc/env' /var/db/pkg/**/**/CONTENTS|sed -e's:/CONTENTS.*::' -e's:/.*/::'|sort -u

ulenrich ... the subject clearly states "[a]ccidentally removed /bin/env", so why would we be looking for "/etc/env", rather than, as has been suggested, re-merging coreutils?

Note that with the above you will also match /etc/environment (sys-libs/pam) as the pattern is not selective enough, you might also be less greedy with the use of sed, and prepare the output suitable for emerge, eg:

Code:
find /var/db/pkg -name CONTENTS -exec grep -H "env.d" {} \; | awk -F/ '!a[$6]++{print "=" $5 "/" $6}'

best ... khay

EDIT: corrected quotation


Last edited by khayyam on Sat Oct 13, 2012 10:36 am; edited 2 times in total
Back to top
View user's profile Send private message
b-lion
n00b
n00b


Joined: 01 Oct 2012
Posts: 2

PostPosted: Mon Oct 01, 2012 11:45 pm    Post subject: Reply with quote

Thanks for all the responses. Re-installing coreutils did the trick.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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