Date: Wed, 29 Mar 2000 14:06:49 -0800 (PST) From: Doug Barton <Doug@gorean.org> To: Vodyanoi <hawk76@mail.ev1.net> Cc: FreeBSD Mail List -- Houston <hou-freebsd@cityscope.net>, FreeBSD-Questions <freebsd-questions@FreeBSD.org> Subject: Re: Prompt and Path questions Message-ID: <Pine.BSF.4.21.0003291356430.49934-300000@dt051n0b.san.rr.com> In-Reply-To: <200003290559.AA228787102@mail.ev1.net>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Wed, 29 Mar 2000, Vodyanoi wrote: > Hello all, > I appear to have a small issue with the setup of both my path and prompt settings. I am using sh for my shell. I have edited the prompt setting in the .shrc file in the home dir but it didn't work quite the way I expected it to. below is what I have in this file. what I had before was the same, I only added the "| `pwd'#" & $ sections. You also have some issues with mail. :) Please wrap your lines at 75 columns or so. I can't see anything past the word "prompt" in this sentence above without some serious scrolling. Fortunately for you, this is a subject near and dear to my heart. :) Take a look at the files I have attached. They approach this problem in a slightly more efficient way than the current default files in skel. > This gives the the prompt that I want (username@host|<current path>$) but it dosn't change when I change paths. I searched the archives for the mailing list and found somethig about using CD insteadof PS1 but not sure what CD is or how to set that up. That's because PS1 is set static when you initialize your shell. More modern shells (like Bash) allow you to do dynamic things with your prompt. I would suggest you install Bash, and then take a look at http://freebsd.simplenet.com/Bash-prompts.txt. If you're determined to stick with sh, you can create a function called 'cd' that replaces the builtin cd, and use that function to reset your prompt each time. > Also I seem to be having a problem with some commands that are located in my /usr/local/bin and /usr/local/sbin not running. I get the error message command not found and have to enter the full path with the command. I've checked and these paths are in my path setting. this happens mainly with programs that I've installed and not with the commands and programs that install orignally. > If someone could explain this to me or point me to the documentation about this that I've been missing. i am sure it's out there somewhere I just can't seem to find it Your PATH variable is not being set properly. The .profile I included sets more than you will probably need. Also, look at /etc/login.conf. Good luck, Doug -- "So, the cows were part of a dream that dreamed itself into existence? Is that possible?" asked the student incredulously. The master simply replied, "Mu." [-- Attachment #2 --] # $FreeBSD$ # # .shrc - Bourne shell startup file # # This file will be used if the shell is invoked for interactive use and # the environment variable ENV is set to the name of this file. # # See also sh(1), environ(7). # # Make interactive shells a little more friendly set -o emacs # Search path for cd(1) CDPATH=.:$HOME # Prompt _USERNAME=`whoami` PS1="$_USERNAME@`hostname -s`" case "$_USERNAME" in root) PS1="${PS1}# " ;; *) PS1="${PS1}$ " ;; esac # Allows permissions of -rwxr-xr-x umask 022 # General aliases alias la='ls -A' alias lf='ls -AF' alias ll='ls -loaF' alias m=$PAGER alias g='egrep -i' # Shell specific aliases alias h='fc -l' alias j=jobs # For the paranoid #alias cp='cp -ip' #alias mv='mv -i' #alias rm='rm -i' # Implement a csh-like unlimit command. Unpriviliged users may # not be able to change some of these limits. unlimit ( ) { echo ' Setting sock buf size'; ulimit -b unlimited echo ' Setting core file size'; ulimit -c unlimited echo ' Setting data size'; ulimit -d unlimited echo ' Setting file size'; ulimit -f unlimited echo ' Setting locked mem size'; ulimit -l unlimited echo ' Setting res size'; ulimit -m unlimited echo ' Setting fds'; ulimit -n unlimited echo ' Setting stack size'; ulimit -s unlimited echo ' Setting cpu time'; ulimit -t unlimited echo ' Setting max processes'; ulimit -u unlimited } # Uncomment to display a random cookie each login: #[ -x /usr/games/fortune ] && /usr/games/fortune [-- Attachment #3 --] # $FreeBSD$ # # .profile - Bourne Shell startup script for login shells # # see also sh(1), environ(7). # [ -x /usr/local/bin/bash ] && exec /usr/local/bin/bash --rcfile $HOME/.bash_profile # Export all the environment variables to clean things up a bit set -o allexport # Remove /usr/games and /usr/X11R6/bin if you want PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:/usr/games:$HOME/bin # Setting TERM is normally done through /etc/ttys. Only override # if you're sure that you'll never log in via telnet, xterm or a # serial line. # Use cons25l1 for iso-* fonts TERM=${TERM:-cons25} EDITOR=vi PAGER=more BLOCKSIZE=K # Turn off allexport to prevent possible foot-shooting set +o allexport # Set ENV to a file invoked each time sh is started for interactive use. ENV=$HOME/.shrc; export ENV
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0003291356430.49934-300000>
