LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-06-2008, 01:03 PM   #1
sophisticate
Member
 
Registered: Oct 2007
Distribution: CentOS 5
Posts: 39

Rep: Reputation: 15
problem with echoing variables


hi
i edit the /etc/profile and set a new variable and exported it and i tried to echo this variable but I got nothing and when i checked the exit status i got 0 which mean good in linux

CAN ANYBODY HELP ME PLEASE !!!
 
Old 01-06-2008, 01:10 PM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
Did you source /etc/profile or logout and back in again after setting the variables?
 
Old 01-06-2008, 01:14 PM   #3
sophisticate
Member
 
Registered: Oct 2007
Distribution: CentOS 5
Posts: 39

Original Poster
Rep: Reputation: 15
no
i su to root then get back again to normal user using su command
 
Old 01-06-2008, 01:43 PM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
Try what I mentioned above and see if that helps.
 
Old 01-08-2008, 01:35 AM   #5
sophisticate
Member
 
Registered: Oct 2007
Distribution: CentOS 5
Posts: 39

Original Poster
Rep: Reputation: 15
well i used ssh command and it works correctly...
but can i know what is the diffrence between ssh command an su command
 
Old 01-08-2008, 02:42 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Did you use
Code:
su - username
? The minus sign is equivalent to the -l or --login option, which forces to act as a new login and sources all the initialization files. Otherwise, the environment of the previous user is mantained!
 
Old 01-08-2008, 12:45 PM   #7
sophisticate
Member
 
Registered: Oct 2007
Distribution: CentOS 5
Posts: 39

Original Poster
Rep: Reputation: 15
yes, It works great I'm very thankful for your help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
JAVA: echoing current user indienick Programming 17 05-05-2006 01:49 AM
Mp3 are echoing hellfire73 Linux - Software 6 03-19-2006 12:10 AM
Threads synchronisation problem (mutex variables and contitional variables) zahadumy Programming 6 12-07-2005 01:30 PM
Problem of echoing to a file happy78 Programming 7 09-28-2005 12:17 AM
Echoing the first and last colums of a textfile ganninu Linux - General 4 06-26-2004 06:54 AM


All times are GMT -5. The time now is 11:25 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration