LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 04-26-2006, 08:55 PM   #1
trysten_x
LQ Newbie
 
Registered: Dec 2004
Distribution: Redhat,mandrake,Freebsd,Solaris 9
Posts: 9

Rep: Reputation: 0
Unhappy !!!URGENT!!! Error after editing /etc/profile


Hi all,

After editing the /etc/profile i am not able to issue any command at all. I have a backup profile under /etc/profile.bak but even logging as root user could not do any thing much, i need to copy this file back to solve the problem. please help

below is the new profile which i cant copy into the /etc/profile as root or normal user because none of the commands works. please give me any other solution.


#ident "@(#)profile 1.19 01/03/13 SMI" /* SVr4.0 1.3 */

# The profile that all logins get before using their own .profile.

trap "" 2 3
export LOGNAME PATH
PATH=$PATH:/usr/local/bin
export PATH
CC=gcc;export CC
if [ "$TERM" = "" ]
then
if /bin/i386
then
TERM=sun-color
else
TERM=sun
fi
export TERM
fi

# Login and -su shells get /etc/profile services.
# -rsh is given its environment in its .profile.

case "$0" in
-sh | -ksh | -jsh | -bash)

if [ ! -f .hushlogin ]
then
/usr/sbin/quota
# Allow the user to break the Message-Of-The-Day only.
trap "trap '' 2" 2
/bin/cat -s /etc/motd
trap "" 2

/bin/mail -E
case $? in
0)
echo "You have new mail."
;;
2)
echo "You have mail."
;;
esac
fi
esac

umask 022
trap 2 3

JAVA_HOME=/usr/j2se
#CATALINA_HOME=/usr/local/tomcat
CATALINA_HOME=/opt/local/tomcat5.5

export JAVA_HOME CATALINA_HOME
export PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar
export CLASSPATH




Below is the problem when i login as root or normal user .

Last login: Thu Apr 27 09:04:48 2006 from 192.168.1.113
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
-sh: PATH=/usr/ccs/bin:/usr/j2se/bin: is not an identifier
$ ls
ls: not found
$ ls
ls: not found


please help me....

 
Old 04-26-2006, 10:10 PM   #2
trysten_x
LQ Newbie
 
Registered: Dec 2004
Distribution: Redhat,mandrake,Freebsd,Solaris 9
Posts: 9

Original Poster
Rep: Reputation: 0
Smile found solution

Hi all,

Well i have found a solution to solve the problem and it works.

the solution :

login as root and from the command prompt type /usr/bin/vi /etc/profile

edit the file as the original, save and rerun profile


it works

cheers
 
Old 04-27-2006, 05:37 AM   #3
apt-get-dude
Member
 
Registered: Mar 2006
Posts: 98

Rep: Reputation: 15
Use an absolute path (/usr/bin/vi) to fix your path. You have to do it as root, a regular user can't overwrite a file in /etc (/etc/profile in this case)
 
  


Reply



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
trying to use Darwin Ports, editing the etc/profile file fyr3 Linux - Newbie 3 09-22-2005 09:41 AM
It's about editing 'etc/profile' bicbac Linux - Newbie 5 08-30-2005 09:06 PM
editing profile.. andox LQ Suggestions & Feedback 2 07-05-2003 06:50 PM
Editing path permanently...but I don't have .bashrc or .profile shock_ez Linux - Newbie 6 07-02-2003 05:16 PM
About Editing the User Profile emmanuelmathew LQ Suggestions & Feedback 2 02-06-2003 03:48 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 04:55 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration