Find the answer to your Linux question:
Results 1 to 4 of 4
ok i need to create a startup script to run when this user logs in that would set the term variable to vt100 and export it. it will also echo ...
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Posts
    5

    creating log in script for a specific user

    ok i need to create a startup script to run when this user logs in that would set the term variable to vt100 and export it. it will also echo hello, $logname at the command prompt.

    i have created a .profile with this in it

    Code:
    export $TERM = "vt100"
    echo Hello, $LOGNAME
    however, when i log in the user it does not do the echo.

  2. #2
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    rgfirefly24, I posted this in your other thread but I'll put it here too in case you missed it.

    Try changing the first line to:
    Code:
    export TERM=vt100

  3. #3
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    Is bash the login shell for the account? If so the bash manpage says:

    When bash is invoked as an interactive login shell, or as a non-inter-
    active shell with the --login option, it first reads and executes com-
    mands from the file /etc/profile, if that file exists. After reading
    that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.pro-
    file, in that order, and reads and executes commands from the first
    one that exists and is readable.

    So if .bash_profile or .bash_login exists then your .profile won't be executed.

  4. #4
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by vsemaska View Post
    Is bash the login shell for the account? If so the bash manpage says:

    When bash is invoked as an interactive login shell, or as a non-inter-
    active shell with the --login option, it first reads and executes com-
    mands from the file /etc/profile, if that file exists. After reading
    that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.pro-
    file, in that order, and reads and executes commands from the first
    one that exists and is readable.

    So if .bash_profile or .bash_login exists then your .profile won't be executed.
    Note also that it's only for *login* shells. Which means that this will not be run on an xterm unless you explicitly pass the --login option. In those cases, the right file is ~/.bashrc.

    With some exceptions, most stuff under ~/.bash_profile will not be problematic on ~/.bashrc, so, some people just created one of these files, and symlink it to the other.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...