LOGIN ERROR SOLUTION FOR BACKTRACK 5
Some of us face this very unusual error while logging on to the Backtrack. The following message is shown in this error.
"-bash: /etc/profile:
line 1: syntax error near unexpected token".
So when we go to error file location inside the file there is the next code :
ERROR CODE :
n# /etc/profile: system-wide .profile
file for the Bourne shell (sh(1))\n
# and Bourne compatible shells
(bash(1), ksh(1), ash(1), ...).\n\nif
[ -d /etc/profile.d ]; then\nfor i in
/etc/profile.d/*.sh; do\nif [ -r $i ];
then\n. $i\nfi\ndone\nunset i\nfi\n\nif
[ "$PS1" ]; then\nif [ "$BASH" ];
then\nPS1=u@h:w$ \nif [ -f
/etc/bash.bashrc ];
then\n.
/etc/bash.bashrc\nfi\nelse\nif [ "id -u" -eq 0 ];
then\nPS1=# \nelse\nPS1=$
\nfi\nfi\nfi\n\numask
022\nPT5HOME=/opt/pt\nexport PT5HOME
SOLUTION :
SOLUTION :
Fix the formatting, in the code replace "/n" by actual Newlines and remove the spurious 'n' at the begning, then the code works properly. Thus new code will look like this.
Fix the formatting, in the code replace "/n" by actual Newlines and remove the spurious 'n' at the begning, then the code works properly. Thus new code will look like this.
#
/etc/profile: system-wide .profile file for the Bourne shell (sh(1))
#
and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if
[ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r "$i" ]; then
. "$i"
fi
done
unset i
fi
if
[ -n "$PS1" ]; then
if [ -n "$BASH" ]; then
PS1='u@h:w$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
umask
022
PT5HOME=/opt/pt
export
PT5HOME
Now sava this file and reboot your system to apply the change. That's it......!!
No comments:
Write comments