looking for .profile examples | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


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.

looking for .profile examples

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-03-2002
JimC JimC is offline
Registered User
 
Join Date: Apr 2002
Last Activity: 3 April 2002, 2:38 PM EST
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Java looking for .profile examples

I'm looking for some 'well documented' .profile examples
Sponsored Links
    #2  
Old 04-03-2002
Kelam_Magnus's Avatar
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
Registered User
 
Join Date: Aug 2001
Last Activity: 18 April 2013, 3:03 PM EDT
Location: San Antonio, TX,
Posts: 1,070
Thanks: 0
Thanked 4 Times in 4 Posts
This is too general, like what. What do you want to do. Almost anything can be defined in a .profile.

What would you like to do.

You can change the prompt. You can alter the $PATH variable, add alias commands for common commands with options that you type. ex. alias dir="ls -lrt". For root user .profile, you can trap user commands that su to root as separate files by userID.

There is the system default file /etc/profile or the one that is used to create new users in /etc/skel/.profile

Please expound on your question.

Sponsored Links
    #3  
Old 04-03-2002
JimC JimC is offline
Registered User
 
Join Date: Apr 2002
Last Activity: 3 April 2002, 2:38 PM EST
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
for starters in need a definition for syntax for the PATH command. The .profile I have been given had 2 seperate PATH sections (not sure why) and I'm unable to run commands that I know reside in /usr/sbin (even though its listed in the second PATH statement of my current .profile file).

If you can point me to a source online I'd appreciate it. I did a search here and didn't get to much. I'd appreciate any good example that has been documented so I can interpret what has been accomplished with a specific command.

Thanks,
    #4  
Old 04-03-2002
Kelam_Magnus's Avatar
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
Registered User
 
Join Date: Aug 2001
Last Activity: 18 April 2013, 3:03 PM EDT
Location: San Antonio, TX,
Posts: 1,070
Thanks: 0
Thanked 4 Times in 4 Posts
Please post what you have of your .profile, it will help to figure out why.

Here is a sample from one of my boxes.

PATH=/usr/sbin:/usr/localcw/sbin:$PATH:/sbin:
export PATH

Sometimes applications will require to modify the path and have an entry like this.


PATH=$PATH:$USERHOME/bin
export USERHOME

USERHOME contains the user's home directory

So that executable files in the Admin's home directory under sub directory bin will be seen by root's PATH variable.

Sponsored Links
    #5  
Old 04-03-2002
JimC JimC is offline
Registered User
 
Join Date: Apr 2002
Last Activity: 3 April 2002, 2:38 PM EST
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

Code:
SHELL=/usr/bin/ksh
EDITOR=/usr/bin/vi;export EDITOR
VISUAL=/bin/vi;export VISUAL
umask 022
PATH=/bin:/usr/local/bin:$PATH:/usr/bin:/usr/sbin:/home/bsilverio/bin:/usr/bin/X
11:.;export PATH
DBA=/usr/local/bin/dba/
TOOLS=/usr/local/bin/scripts/
ORACLE_SID=TEST;export ORACLE_SID
ORAENV_ASK=YES
export DBA
export TOOLS

PAGER="more";export PAGER
VISUAL=/bin/vi;export VISUAL
LPDEST="cchp4";export LPDEST
HOSTN="numa1 "
WHOAM=`whoami`
echo ";$HOSTN:$WHOAM"

who

if  [ $TERM == "xterm" ]
        then
        echo "XTERM"
        PS1="$HOSTN$ "
fi

#
cwd() {
        cd $*
PWD=`pwd`
WHOAM=`whoami`
echo ";$HOSTN:$WHOAM:$PWD"
        }
        alias cd=cwd
cd .
#
PATH=/bin:/usr/local/bin:/opt/bin:/usr/bin:/u00/app/oracle/product/8.1.5/bin:/us
r/sbin:/home/bsilverio/bin:/usr/bin/X11:$PATH:.;export PATH

. /usr/local/bin/oraenv
SID() {
if [ -z "${1}" ]
then
echo "Your ORACLE_SID type is set to $ORACLE_SID"
else
echo "Your ORACLE_SID was $ORACLE_SID\c"
# ORACLE_SID=${1}
export ORACLE_SID
echo " and is now -->>> $ORACLE_SID"
fi ;
}
ORAENV_ASK=
/usr/local/bin/dbstats

added code tags for readability --oombera

Last edited by oombera; 02-20-2004 at 12:58 PM..
Sponsored Links
    #6  
Old 04-03-2002
Kelam_Magnus's Avatar
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
Registered User
 
Join Date: Aug 2001
Last Activity: 18 April 2013, 3:03 PM EDT
Location: San Antonio, TX,
Posts: 1,070
Thanks: 0
Thanked 4 Times in 4 Posts
I think it may be a permissions problem. Are you sure that you can execute the file in /usr/sbin?

What are its permissions? Are you just at user level or "root" when you try to execute this command?

When I look at my own /usr/sbin, there are several files that don't have world executable set.

Also, it looks as though the second PATH at the bottom contains all of the directories that the first one has. I would comment out the first one with a # sign. Then log out and log back in. I think you would be better served by this.

In addition, I would take out the . after the $PATH: That can be a problem for security, but I don't think that is related to your problem.

Your problem is either a PATH problem or a permissions problem. Try that and let me know.

it looks like you have HPUX. Here are some alias commands that I have setup.

# list of my aliases
alias dir='ls -la'
alias lt='ls -lt'
alias lrt='ls -lrt'
alias pp='ps -aef|grep'
alias lsfg='lsf |grep '\/''

Hope this helps.

Sponsored Links
    #7  
Old 04-03-2002
JimC JimC is offline
Registered User
 
Join Date: Apr 2002
Last Activity: 3 April 2002, 2:38 PM EST
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Unfortunately we're currently on a Data General w/plans for a new server in place s/b within next 2 months. Accessing from windows 200 platform.

When I try to run the command w normal logon this is the result

$ dg_system -g hardware
UX:ksh: ERROR: dg_system: not found
$

if I cd to the correct directory it runs fine.

is the syntax
PATH=entry:entry:$PATH
export PATH

PATH= to get started
: to seperate directory paths
$PATH to end statement
export to run command

-----
Terminal type issue. w/ current .profile I receive this error

tput: unknown terminal "vt420"

after entering below things work OK
TERM=vt100
export TERM

----
after initial logon I must run

stty erase <backspace>

to get backspace to work properly
----
I also remember some helpful aliases that would allow 2 up, 4up,... printing.

Do you use any of that?

----
Thanks for your help. Things are starting to work.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
lwp-request examples ajaypadvi Shell Programming and Scripting 2 07-27-2011 04:06 AM
Awk and Sed examples j_panky Emergency UNIX and Linux Support 7 05-14-2010 12:16 AM
trap in etc/profile and user .profile Smith Infrastructure Monitoring 4 09-01-2009 08:58 PM
need examples? wmosley2 Shell Programming and Scripting 1 12-14-2003 09:47 PM
changed .profile but didnt ./.profile, yet reflected changes yls177 UNIX for Dummies Questions & Answers 4 12-05-2002 10:21 AM



All times are GMT -4. The time now is 01:27 PM.