LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices

Reply
 
Search this Thread
Old 05-06-2004, 12:23 PM   #1
lolmc
Member
 
Registered: Nov 2001
Location: Wirral.Merseyside - UK
Distribution: Mandrake 10.0 on desktop and 9.2 laptop
Posts: 60

Rep: Reputation: 15
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.
 
Old 05-06-2004, 12:27 PM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
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.

Last edited by Andrew Benton; 05-06-2004 at 12:37 PM.
 
Old 05-06-2004, 12:49 PM   #3
lolmc
Member
 
Registered: Nov 2001
Location: Wirral.Merseyside - UK
Distribution: Mandrake 10.0 on desktop and 9.2 laptop
Posts: 60

Original Poster
Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
accidental use of 'bind' command naedaneth Linux - Newbie 1 11-05-2004 03:22 PM
Accidental Deletion of some /usr/lib files Huddlebum Linux - General 17 03-08-2004 02:05 PM
Accidental Deletion of "home.desktop" Ian Linux - Newbie 2 03-06-2004 11:36 AM
accidental mke2fs sarahan Linux - General 1 11-15-2003 04:58 AM
accidental deletion of /bin/ steve1394 Linux - Newbie 3 11-03-2003 02:06 PM


All times are GMT -5. The time now is 03:21 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration