LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   accidental deletion of /etc/profile on MDK9.2 (https://www.linuxquestions.org/questions/mandriva-30/accidental-deletion-of-etc-profile-on-mdk9-2-a-178614/)

lolmc 05-06-2004 12:23 PM

accidental deletion of /etc/profile on MDK9.2
 
i was amending the /etc/profile file to put in an export for my java installation with kate and though I pressed save it actually nuked the file! i can't log in accept as root and i have no idea how to get the file back.Could someone post me a copy of theirs if that's ok so I can put it back on my system or is that not a valid way of fixing this?
can MDK9.2 regenerate the file if I use the cd in rescue mode and if so what are the commands to issue/url to peruse for a run through of what to do?
Hope someone can help and thanks for your time.

Andrew Benton 05-06-2004 12:27 PM

Code:

# /etc/profile -*- Mode: shell-script -*-
# (c) MandrakeSoft, Chmouel Boudjnah <chmouel@mandrakesoft.com>

loginsh=1

# Users generally won't see annoyng core files
[ "$UID" = "0" ] && ulimit -S -c 1000000 > /dev/null 2>&1

if ! echo ${PATH} |grep -q /usr/X11R6/bin ; then
    PATH="$PATH:/usr/X11R6/bin"
fi

if [ "$UID" -ge 500 ] && ! echo ${PATH} |grep -q /usr/games ; then
    export PATH=$PATH:/usr/games
fi

umask 022

USER=`id -un`
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
HISTCONTROL=ignoredups
HOSTNAME=`/bin/hostname`
HISTSIZE=1000

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
    INPUTRC=/etc/inputrc
fi

# some old programs still use it (eg: "man"), and it is also
# required for level1 compliance for LI18NUX2000
NLSPATH=/usr/share/locale/%l/%N

export PATH PS1 USER LOGNAME MAIL HOSTNAME INPUTRC NLSPATH
export HISTCONTROL HISTSIZE

for i in /etc/profile.d/*.sh ; do
        if [ -x $i ]; then
                . $i
        fi
done

unset i

I do stupid things like that all the time and I find it very useful to have at least one other Linux install that I can boot into if I need to fix /etc/fstab or whatever I've screwed up this time. I just mounted my Mandrake 9.2 partition on /mnt/mandrake to be able to copy and paste that. If I needed I could edit it any way I choose. My old faithful is Mandrake 9.1. I can install it with Gnome and all the development tools to build Linux From Scratch on a partition that's only 800Mb. It's a tiny thing but it's very powerful to have a backup boot option.

lolmc 05-06-2004 12:49 PM

Thanks a lot for that it saved my life and sanity.I'm toying with putting stuff like this inb a cvs repository ion the future - just in case.


All times are GMT -5. The time now is 09:52 AM.