TheNovice Posted February 6, 2006 Report Share Posted February 6, 2006 I am trying to create a new alias for when I shutdown my box. As Chalex20 told me on a previous message I open /etc/bashrc with vi and added the following line (as root) alias shut='shutdown -h +1 "That's all folks for today"' I rebooted the box but it is not working. Did i miss something? Thanks TheNovice Quote Link to comment Share on other sites More sharing options...
ramfree17 Posted February 7, 2006 Report Share Posted February 7, 2006 can you post the contents of your $/.bashrc and $/.bash_profile? i am wondering if they reference the /etc/bashrc. ciao! Quote Link to comment Share on other sites More sharing options...
TheNovice Posted February 7, 2006 Author Report Share Posted February 7, 2006 This is my bashrc System wide functions and aliases # Environment stuff goes in /etc/profile # by default, we want this to get set. # Even for non-interactive, non-login shells. if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then umask 002 else umask 022 fi # are we an interactive shell? if [ "$PS1" ]; then case $TERM in xterm*) PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' ;; *) ;; esac [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " if [ -z "$loginsh" ]; then # We're not a login shell for i in /etc/profile.d/*.sh; do if [ -x $i ]; then . $i fi done fi fi unset loginsh alias today='date +"%A, %B %-d, %Y"' alias shut='shutdown -h +1 "That's all folks"' ~ ~ "bashrc" 36L, 763C 36,46 All This is my .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH unset USERNAME alias l='ls -l' ".bash_profile" 16L, 245C 1,1 Top TheNovice Quote Link to comment Share on other sites More sharing options...
jboy Posted February 7, 2006 Report Share Posted February 7, 2006 That bashrc that you just posted looks like /etc/bashrc. Ramfree17 asked you to post the .bashrc (note the leading period) in your home directory. Please post that. Here is my $HOME/.bashrc, which is the default from the 2006 install: # .bashrc # User specific aliases and functions # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi If your $HOME/.bashrc does not look like the above, that could be your problem. Note that it will execute /etc/bashrc, if that file exists. The period followed by a space before the /etc/bashrc command is a special command that makes any variables that are set in the script available after the script has finished executing. Also, if there is a bashrc (without the leading period) in your home directory, that is not going to get executed when you open a terminal (note your .bash_profile specifically references .bashrc in your home directory, not bashrc). Quote Link to comment Share on other sites More sharing options...
TheNovice Posted February 7, 2006 Author Report Share Posted February 7, 2006 Ooops sorry. here it is: # .bashrc # User specific aliases and functions # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # enable programmable completion features if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi ~ ~ ".bashrc" 13L, 231C 1,1 All TheNovice Quote Link to comment Share on other sites More sharing options...
jboy Posted February 7, 2006 Report Share Posted February 7, 2006 alias shut='shutdown -h +1 "That's all folks"' OK, there is a problem with the extra single quote in "that's all folks" Try this instead: alias shut='shutdown -h +1 "That is all folks"' Quote Link to comment Share on other sites More sharing options...
TheNovice Posted February 7, 2006 Author Report Share Posted February 7, 2006 spot on jboy !! Thanks very much TheNovice Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.