| View previous topic :: View next topic |
| Author |
Message |
b-lion n00b

Joined: 01 Oct 2012 Posts: 2
|
Posted: Mon Oct 01, 2012 7:48 am Post subject: Accidentally removed /bin/env |
|
|
.
Last edited by b-lion on Sun Apr 21, 2013 7:40 am; edited 1 time in total |
|
| Back to top |
|
 |
Ant P. Veteran

Joined: 18 Apr 2009 Posts: 1916 Location: UK
|
Posted: Mon Oct 01, 2012 9:18 am Post subject: |
|
|
| Code: | cp /bin/busybox /bin/env
emerge -1 coreutils |
|
|
| Back to top |
|
 |
fb0x n00b

Joined: 13 Sep 2012 Posts: 4
|
Posted: Mon Oct 01, 2012 9:18 am Post subject: |
|
|
| Reinstall coreutils ? |
|
| Back to top |
|
 |
ulenrich Guru

Joined: 10 Oct 2010 Posts: 463
|
Posted: Mon Oct 01, 2012 10:08 am Post subject: |
|
|
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 |
|
 |
khayyam Veteran


Joined: 07 Jun 2012 Posts: 1241
|
Posted: Mon Oct 01, 2012 9:07 pm Post subject: |
|
|
| 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 |
|
 |
b-lion n00b

Joined: 01 Oct 2012 Posts: 2
|
Posted: Mon Oct 01, 2012 11:45 pm Post subject: |
|
|
| Thanks for all the responses. Re-installing coreutils did the trick. |
|
| Back to top |
|
 |
|