What is the /etc/profile file for?

Discussion in 'iPod touch' started by eozoon, Jan 23, 2008.

  1. eozoon

    eozoon New Member

    Joined:
    Oct 5, 2007
    Messages:
    107
    Likes Received:
    0
    Device:
    2G iPod touch
    Hi, ever since upgrading to 1.1.2 a month or so ago, I've been getting the follow error in Term-vt100 and SSH logins:
    Last login: Wed Jan 23 20:31:53 2008
    /etc/profile:2: command not found: ^M
    /etc/profile:3: command not found: PATH
    /etc/profile:export:4: not an identifier: PATH^M

    There doesn't seems to be anything actually wrong with the machine (PHP works, music / video / ebooks / games all works), so I am not too concerned about it, but just now I tried to get rid of it, nothing aside from deleting the whole profile file would work.

    So now I've deleted the profile file (more like renamed it to profilebak actually) and everything still seems to be working even after a restart. I'm just wondering if it is safe to keep it this way, or should I put the profile file back and try to get used to the error messages.

    Here's the content of my profile file:
    Code:
    # System-wide .profile for sh(1)
    
    PATH = "/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin:/opt/iphone/bin"
    export PATH
    
    TERM="vt102"
    export TERM
    
    if [ "${BASH-no}" != "no" ]; then
    	[ -r /etc/bashrc ] && . /etc/bashrc
    fi
    
  2. EverySound

    EverySound New Member

    Joined:
    Nov 30, 2007
    Messages:
    4
    Likes Received:
    1
    If you have that file you don't need to add the path to a command when you use it. Like if you use EricaUtilities you just add /var/root/bin/ to the path and you won't need to say the path everytime you write a command.

    Cheers,
    EverySound
  3. Scythal

    Scythal New Member

    Joined:
    Nov 27, 2007
    Messages:
    413
    Likes Received:
    4
    Device:
    iPod touch
    Edit your file with a program that can remove dos-like end of lines. In Windows or dos, the end of line is two ASCII codes: 0x0d, 0x0a. In Unix-like OS'es, and for the iPod, it has to be 0x0a only. Some editors like UltraEdit offer the possibility to convert to Unix format, try that.

    Alternatively, since you have the terminal installed, you can modify that with the following command:

    Code:
    mv /etc/profile /etc/profile.dos
    tr -d '\r' < /etc/profile.dos > /etc/profile

Share This Page