LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-11-2008, 09:49 PM   #1
icecoolcorey
LQ Newbie
 
Registered: Jun 2008
Posts: 19

Rep: Reputation: 0
Help? how to execute the /etc/profile without having the user exit then logon?


Hi,
I was wondering how to execute the /etc/profile without having the user exit the terminal then log back in?
 
Old 06-11-2008, 09:54 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Use the source Luke:
Code:
source /etc/profile
 
Old 06-11-2008, 10:07 PM   #3
icecoolcorey
LQ Newbie
 
Registered: Jun 2008
Posts: 19

Original Poster
Rep: Reputation: 0
how about in a script? didn't seem to work in a script file.
 
Old 06-12-2008, 09:48 AM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Quote:
Originally Posted by icecoolcorey View Post
how about in a script? didn't seem to work in a script file.
What do you mean by “didn’t seem to work”? Is it that the expected variables are not set when the script exits? This is normal behavior, and I’m afraid you can’t get variables from a child to propagate to the parent.

This is why “sh /etc/profile” has no measurable effect on the variables of the calling shell. If you actual commands which perform something of persistence (such as empty the temp folder or schedule an at command), then they will of course work as intended.
 
  


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
Mount a remote homedir at logon: How to share a Firefox profile between two machines? ask Linux - Networking 1 07-25-2007 03:44 PM
In perl is there a way when i call exit function to execute a subroutine alix123 Programming 3 06-01-2007 05:38 AM
system profile vs user profile bonito SUSE / openSUSE 3 06-28-2006 01:02 PM
execute a script upon logon Starch Linux - Newbie 3 05-12-2005 04:04 PM
SSH: execute one command then exit kleptophobiac Linux - Software 10 01-30-2004 08:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:31 PM.

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