Sponsored Content
Full Discussion: .bashrc file
Top Forums Shell Programming and Scripting .bashrc file Post 302365771 by Smiling Dragon on Wednesday 28th of October 2009 03:22:10 AM
Old 10-28-2009
Code:
echo 'PS1=\'[\h:\w]$ \'' > .bashrc

Or just:
Code:
<favourite editor> .bashrc

then type what you wish in there
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

from bashrc to sh..??

:) as soon as i installed my software a couple of weeks ago.. (fedora core 2 vs, 2.6.8-1.521) i decided to switch the shell to sh shell and i know that .bashrc is the bash profile file(???) i want to use the sh version of the same file and make it the main profile file.. how can I switch it and... (3 Replies)
Discussion started by: moxxx68
3 Replies

2. UNIX for Dummies Questions & Answers

.bashrc file is an initialization file run by each interactive invocation

I search the web and found the following statements ..... The /etc/profile file is a system wide initialization script which is run at login time for each user, while .profile is the users own login initialization. The .bashrc file is an initialization file run by each interactive invocation... (1 Reply)
Discussion started by: cy163
1 Replies

3. Shell Programming and Scripting

Can I modify the .bashrc file instead of .profile file to customize my login?

Hello, I got this question which tells me to customize my login script. Some people in the forums suggested to modify the .profile file in my home directory. I did so, but none of my customizations show up when I open the terminal after. So, I tried to modify other files in my home directory,... (1 Reply)
Discussion started by: Hyunkel
1 Replies

4. Shell Programming and Scripting

how do i look for my .bashrc file

hi i am using cygwin and would like to modify my .bashrc file. How can search to find where it is? I have looked at multiple bashrc file in /etc but none of them seemed to work..thanks (12 Replies)
Discussion started by: npatwardhan
12 Replies

5. Shell Programming and Scripting

bashrc

i have made a few changes to my bashrc file...have set a few environmental variable that my shell scripts use. Is there any way that these changes can reflect in evryone else's bashrc who are in the network or do all of them have to copy those changes to their own bashrc file. (2 Replies)
Discussion started by: lassimanji
2 Replies

6. Shell Programming and Scripting

bashrc not saving changes

I am trying to do some changes at bashrc file located at /etc directory of my server. First I tried to edit bashrc via FTP downloaded on my pc changed it and loaded back, but it seems like changes are not reflecting. Therefore I tried to change it via putty shel using vim bashrc command. but... (4 Replies)
Discussion started by: ninadgac
4 Replies

7. Shell Programming and Scripting

Modifying the .bashrc

I have modified the .bashrc. The problem is that when I write a long command, it does not write on the next line but continues to write on the same line. # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for... (1 Reply)
Discussion started by: kristinu
1 Replies

8. UNIX for Dummies Questions & Answers

Bashrc File - Conditional Command Execution?

Hello All, I was wondering if there is a way to execute a command in my ".bashrc" file based on how I logged into the PC? I was thinking maybe there is a way to check how the user (*myself) logged in, maybe somehow with the who command along with something else, but I'm not sure... I know I... (7 Replies)
Discussion started by: mrm5102
7 Replies

9. OS X (Apple)

A system deletes my .bashrc file

It deletes my .bashrc file rarely but predictability after some unknown count of Mac's restarts. Has someone ever faced such behavior? How do I prevent OS X from modifying .bashrc? What ownership/permission should I set up to not let it happen? OS X Lion. (6 Replies)
Discussion started by: scrutinizerix
6 Replies
aepromptcmd(1)															    aepromptcmd(1)

NAME
aepromptcmd - change prompt color by change state SYNOPSIS
PROMPT_COMMAND="aepromptcmd" DESCRIPTION
The bash(1) shell has an interesting property: If the PROMPT_COMMAND vaiable is set, the value is executed as a command prior to issuing each primary prompt. (Actually, it can be a seties of semicolon separated commands.) In order to change the text back to normal, the PS1 variable needs to have "33[0m" somewhere near the end, otherwise things can get a little difficult to read. If you are using bash(1), you need to let it know these are unprintable (like this: "[33[0m]") or it messes up command line editing. The aepromptcmd command is used to set the color of the prompt, based on the state of the current change. This is an idea taken from Kent Beck's Test Driven Development book. If the change is in the being developed or being integrated state and it needs to be built, the prompt is red; if it is built but it needs to be tested, the prompt is magenta, otherwise it is green. Example Here is a short script you can put in your .bashrc file to turn on prompt coloring: if [ "$PS1" ] then case "$PROMPT_COMMAND" in "" ) PROMPT_COMMAND="aepromptcmd" PS1="$PS1^[[0m" ;; *aepromptcmd*) ;; *) PROMPT_COMMAND="$PROMPT_COMMAND;aepromptcmd" PS1="$PS1[33[0m]" ;; esac export PROMPT_COMMAND export PS1 fi Note that this usually leaves your prompt default (black) when you are not somewhere inside a development directory. Limitations The aepromptcmd command uses the ANSI color escape sequences. It really should to use the tigetstr(3) function from terminfo(3) to do this in a terminal independent way. Code contributions welcome. OPTIONS
The following options are understood: -Change number This option may be used to specify a particular change within a project. See aegis(1) for a complete description of this option. -Project name This option may be used to select the project of interest. When no -Project option is specified, the AEGIS_PROJECT environment variable is consulted. If that does not exist, the user's $HOME/.aegisrc file is examined for a default project field (see aeu- conf(5) for more information). If that does not exist, when the user is only working on changes within a single project, the project name defaults to that project. Otherwise, it is an error. -Help This option may be used to obtain more information about how to use the aepromptcmd program. -Verbose By default error messages are supressed, so that the prompt will be normal when you are outside an Aegis work area. Use this option to tuen error messages back on. See also aegis(1) for options common to all aegis commands. All options may be abbreviated; the abbreviation is documented as the upper case letters, all lower case letters and underscores (_) are optional. You must use consecutive sequences of optional letters. All options are case insensitive, you may type them in upper case or lower case or a combination of both, case is not important. For example: the arguments "-project, "-PROJ" and "-p" are all interpreted to mean the -Project option. The argument "-prj" will not be understood, because consecutive optional characters were not supplied. Options and other command line arguments may be mixed arbitrarily on the command line, after the function selectors. The GNU long option names are understood. Since all option names for aepromptcmd are long, this means ignoring the extra leading '-'. The "--option=value" convention is also understood. EXIT STATUS
The aepromptcmd command will exit with a status of 1 on any error. The aepromptcmd command will only exit with a status of 0 if there are no errors. ENVIRONMENT VARIABLES
See aegis(1) for a list of environment variables which may affect this command. See aepconf(5) for the project configuration file's project_specific field for how to set environment variables for all commands executed by Aegis. COPYRIGHT
aepromptcmd version 4.24.3.D001 Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Peter Miller The aepromptcmd program comes with ABSOLUTELY NO WARRANTY; for details use the 'aepromptcmd -VERSion License' command. This is free soft- ware and you are welcome to redistribute it under certain conditions; for details use the 'aepromptcmd -VERSion License' command. AUTHOR
Peter Miller E-Mail: millerp@canb.auug.org.au //* WWW: http://www.canb.auug.org.au/~millerp/ Reference Manual Aegis aepromptcmd(1)
All times are GMT -4. The time now is 12:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy