Find the answer to your Linux question:
Results 1 to 2 of 2
Hi all, We have a linux machine in which we login as root and EXPORT certain variables. If I login to the server in my machine and do a EXPORT ...
  1. #1
    Just Joined!
    Join Date
    Jul 2008
    Posts
    3

    Need Ino on EXPORT variables

    Hi all,

    We have a linux machine in which we login as root and EXPORT certain variables.

    If I login to the server in my machine and do a EXPORT and then when I give "printenv" It displays the value exported.

    If I login in another window and If I check for the variable it displays as "variable not exported".

    Many people will be logging into the server using root and EXPORT variables.

    Is there some way I can see all the exported variables(in the server)


    Thanks

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by ramkriz View Post
    Hi all,

    We have a linux machine in which we login as root and EXPORT certain variables.

    If I login to the server in my machine and do a EXPORT and then when I give "printenv" It displays the value exported.

    If I login in another window and If I check for the variable it displays as "variable not exported".

    Many people will be logging into the server using root and EXPORT variables.

    Is there some way I can see all the exported variables(in the server)


    Thanks
    Variables are exported into a shell, so it's a shell dependent thing. The files that are sourced into the current shell depends usually on the way you open it.

    For bash, login shells use ~/.bash_profile, while non-login ones use ~/.bashrc. There are many more rc files involved, check the bash man page for the complete list.

    For that same reason, you can only list the vars on the current shell, since the environment is local to the shell.

Posting Permissions

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