The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to edit a txt file ? RRVARMA Shell Programming and Scripting 4 05-30-2008 08:40 AM
edit a file using ksh meghana Shell Programming and Scripting 3 04-16-2008 11:04 AM
Edit value in File sewood Shell Programming and Scripting 1 03-18-2008 02:11 AM
file edit help sentak Shell Programming and Scripting 10 11-14-2006 08:20 AM
Edit an ISO / dd file? WIntellect Filesystems, Disks and Memory 4 11-20-2002 05:21 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-15-2007
duke0001 duke0001 is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 131
How to edit env file

A coworker of mine wants to add some environment variables to env file. Please advise how to do it. He couldn't use: more or vi on the file. Thanks.
  #2 (permalink)  
Old 02-15-2007
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
What env file? Do you mean the actual environment? You can't use vi on the environment, you have to directly set the variables. In sh/ksh/bash, you can set the env variables like this:
Code:
PATH=/usr/bin:/usr/sbin:/sbin:/usr/local/bin; export PATH
In csh/tcsh, you do it like this:
Code:
setenv PATH '/usr/bin:/usr/sbin:/sbin'
If you want to have the variables set automatically when you login, set the variables in the appropriate files. You can get the filenames from the man pages of the appropriate shell.
  #3 (permalink)  
Old 02-16-2007
johnf johnf is offline
Registered User
  
 

Join Date: May 2006
Location: England
Posts: 284
/etc/environment and /etc/profile will set the global variables. Do not forget that the local .profile will make modifications. This answer is from an AIX prospective but I believe the files are the same across all platforms.
  #4 (permalink)  
Old 02-16-2007
duke0001 duke0001 is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 131
blowtorch, johnf:

Thanks so much. Very clear description. I will tell my coworker.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:14 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0