The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Reading a file and writing the file name to a param file. thebeginer UNIX for Advanced & Expert Users 1 10-05-2007 01:38 PM
Reading file names from a file and executing the relative file from shell script anushilrai Shell Programming and Scripting 4 03-10-2006 02:25 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-17-2001
Registered User
 

Join Date: Jul 2001
Location: US
Posts: 25
Question env file

hi all,

My newbie question is: where is the "env" file?

I can define some settings via .profile (with Korn Shell). However, where is the env file that specifies the default PATH, LANG, DISPLAY, TZ... etc?

I am using SPARC/ Solaris 8. Thanks in advance.
Forum Sponsor
  #2  
Old 07-17-2001
Registered User
 

Join Date: Jul 2001
Location: California
Posts: 42

try to read man page of env and environ; this may answer your
question.


__________________
:rolleyes:
  #3  
Old 07-18-2001
mod mod is offline
Registered User
 

Join Date: Jul 2001
Location: Vienna
Posts: 29
Take a look into /etc/profile ... thats executed before the user .profile

there can be also some files like .?shrc (depending on the used shell) or .dtprofile/.dtlogin (used of youre login via X) in the home-dir of the user.

  #4  
Old 10-21-2001
Registered User
 

Join Date: Oct 2001
Posts: 25
Hi,

I have been following the instructions on this topic to search for the env file, so far all env files i have found are executables. I'd like to find the source file so I can take a look into it and figure out the default settings for an environment. I have created a user but not sure if I would need to customize it for this user. However, in the user's .profile, i need to know where the env file is so I can set the ENV variable.

I have created this user with ksh as the login shell.

I appreciate any suggestions or ideas.

Thanks,

Rachael
  #5  
Old 10-22-2001
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
I put my .env file in my home directory, but there's a little more to it.

My .env file defines a bunch of functions and aliases that I want available in all of my interactive shells. On the other hand, I would prefer that my ksh scripts ignore the .env file since they do not need the aliases and it would slow them down. This is a common situation and I use the standard ksh trick to address it:
Code:
FILE=$HOME/.env
ENV='${FILE[(_$-=1)+(_=0)-(_$-!=_${-%%*i*}}]}'
export ENV FILE
This treats FILE as an array where only ${FILE[0]} has a value. That complex subscript computes to 0 for interactive shells and to 1 for non-interactive shells. This trick originates with Dr. Korn himself. It's in his book.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0