Help with .profile


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Help with .profile
# 1  
Old 04-10-2013
Help with .profile

Hello All ,

Hope you are doing good. I have problem need you guys help .

i tried to modify my .profile

i was using

Code:
PS1="[\$LOGNAME@`uname -n`:\$PWD]\$ "
printf "\033]0;`hostname`\007"

and i have alias ( alias e='exit' )as well
now wanna use bash as having good options , and modified as below
Code:
bash -c "echo -ne '\033]0;`hostname`\007'"
export PS1="\e[0;34m\u@\h \w> \e[m "
export PROMPT_COMMAND="echo -n [$(date +%H:%M:%S)]"
bash

here i have three problems .

1. when i am in bash mode , with one exit i am unable to . Need to give two exits to go out from server to putty
2. date is not changing , the date is showing as the same when i logged in
3. if 1st point fails , then i want to have two diff options where the .profile should work for bash and non bash modes .

Hope my problem is clear to you guys and can a resolution ASAP .

Note : this is for a monitoring tool which need to use my ID .
# 2  
Old 04-11-2013
1. This is normal. You run bash as another application. Must be terminated to get back to the main shell.
You can try this in .profile:
Code:
[ -x /bin/bash ] && exec /bin/bash

This should replace the primary login-shell by /bin/bash.
Safer is to change your login shell (in /etc/passwd), e.g. with command
Code:
chsh

2. use stronger quoting so evaluation can happen later:
Code:
export PROMPT_COMMAND='echo -n [$(date +%H:%M:%S)]'

Probably the same, and certainly more efficient is to leave PROMPT_COMMAND unset and instead use
Code:
export PS1="[\D{%H:%M:%S}]\e[0;34m\u@\h \w> \e[m "

3. when bash finds .bash_profile it takes this instead of .profile. If necessary (e.g. becomes appropriate when the login shell was changed to /bin/bash) you can do
Code:
source ~/.profile


Last edited by MadeInGermany; 04-11-2013 at 02:51 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

profile name

How to chage my profile name? (1 Reply)
Discussion started by: kkalyan
1 Replies

2. Shell Programming and Scripting

.profile

Hi, I have entry in .profile like this : alias GH='. /opt/dba/oraadmin/tools/gh.sh' and gh.sh script has some thing like this : #!/bin/ksh echo "Setting the GRID_HOME env variables" ORACLE_SID=GRID_HOME;export ORACLE_SID ORACLE_HOME=$GRID_HOME;export ORACLE_HOME... (1 Reply)
Discussion started by: talashil
1 Replies

3. Shell Programming and Scripting

Profile use

hey'all does anyway know how I can make a script which resides in dir: /mypath/a/b/c/d available to other users without them having to set their environment to PATH=/mypath/a/b/c/d=$PATH export PATH in their profiles. This is done so they can simply type myscript on the... (4 Replies)
Discussion started by: cyberfrog
4 Replies

4. Infrastructure Monitoring

trap in etc/profile and user .profile

Hello I really wonder what's trap in etc/profile and in each user .profile. I try to google for it but I think I have no luck. Mostly hit is SNMP traps which I think it is not the same thing. I want to know ... 1. What's a "trap 2 3" means and are there any other value I can set... (4 Replies)
Discussion started by: Smith
4 Replies

5. UNIX for Dummies Questions & Answers

difference between /etc/profile and .profile?

What is the difference between /etc/profile and .profile? (5 Replies)
Discussion started by: gehlnar
5 Replies

6. UNIX for Dummies Questions & Answers

Where can I read about the difference between "..profile" and ".profile"

Hi I know from reading O Riley's Classic Shell Scripting' that the .profile file is " the shells configuration file" but I am unable to find a reference to what "..profile" means. I have searched on the net, Sams Teach Yourself Unix, Unix Visual Quickstart Guide and Linux in a Nutshell. I have... (2 Replies)
Discussion started by: zorrokan
2 Replies

7. SCO

Difference between .profile and .~/.profile

what is the difference between these two lines, if we use it in korn shell script: .profile .~/.profile (3 Replies)
Discussion started by: maneesh mehta
3 Replies

8. UNIX for Dummies Questions & Answers

How to get to my .profile?

Hi, When I logon to UNIX I go to the root directory. I don't have an assigned user directory. I need to get to my .profile so that I can change things like command prompt. How do I do this? By the way I am using SUN Solaris Thanks. (3 Replies)
Discussion started by: GMMike
3 Replies

9. UNIX for Dummies Questions & Answers

changed .profile but didnt ./.profile, yet reflected changes

hi , i added ls -F to .profile. and i need to do ./.profile for the effect to take effect BUT i didnt and YET the next day when i came to work and log in, the changes took effect. i am on aix. please explain.. thanks (4 Replies)
Discussion started by: yls177
4 Replies

10. UNIX for Dummies Questions & Answers

why i have local.profile, local.cshrc,local.login instead of .profile, .login ?

Hello again ! Thanks for response of my first question. there is my second quesiton why i have local.profile instead of .profile file ? my all files in pwd shoes local. before any file. is anybody can tell me about that ? Thanks Abid Malik (5 Replies)
Discussion started by: abidmalik
5 Replies
Login or Register to Ask a Question