Results 1 to 10 of 10
# Generic $dotdir/bashrc
# Engineering Services (ES)
#
##
# Things the user might wish to set.
export USER_PATH
USER_PATH="~/bin"
export EDITOR
EDITOR=vim # Preferred editor.
export PRINTER
PRINTER=lp # ...
- 05-07-2008 #1Just Joined!
- Join Date
- May 2008
- Posts
- 14
.BASHRC FILE help needed
# Generic $dotdir/bashrc
# Engineering Services (ES)
#
##
# Things the user might wish to set.
export USER_PATH
USER_PATH="~/bin"
export EDITOR
EDITOR=vim # Preferred editor.
export PRINTER
PRINTER=lp # Preferred printer.
export NNTPSERVER
NNTPSERVER=usenet.cisco.com # Preferred news server.
#setenv TERM "xterm-color"
#setenv CLICOLOR "true"
#setenv LSCOLORS "exfxcxdxbxegedabagacad"
##
# Should the full environment be set up even for non-interactive shells?
# Probably not but here is a variable to control it.
export FULLENV
FULLENV=true # 'true' or 'false'
##
# Should all paths (even NFS, which might hang) be set up at login?
# The alias "fullpath" is available to setup your full path. It can
# also be used to change your path by changing USER_PATH above.
export FULLPATH
FULLPATH=true # 'true' or 'false'
################################################## #########################
# Everything above this line helps configure the environment.
# This line should not be removed.
#set dotdir="~/.files"; if ( -f $dotdir/sys_bashrc ) source $dotdir/sys_bashrc
#if ( $FULLENV != "true" && $?prompt == 0 ) exit
################################################## #########################
# Everything below this line is run for interactive shells.
# If you wish the full environment even in non-interactive
# shells set FULLENV above to 'true'.
umask 022 # no write by group or other
unset autologout # disable autologout
set filec # enable filename completion
set fignore=(.o) # don't complete .o files
set history=128 # save last 128 commands
set ignoreeof # disable ^D for logout
set noclobber # disable redirect overwrite
set notify # enable immediate job notify
set prompt="${HOST}:\!> " # shell prompt format
set cdpath =~ # where cd if dir unfound
alias u="uncompress"
alias t="tar -xvf"
alias im="cd $AUTOTEST/local/images"
alias et="cd $AUTOTEST/local/etc"
alias ar="cd $AUTOTEST/local/archive/01-03"
alias log="cd $AUTOTEST/local/logs"
alias test="cd $AUTOTEST/local/tests/cat5k"
alias c="clear"
alias cls="clear"
alias bd="cd syn_core/nmp/nmpflash/build"
alias br="cd ../../../.."
alias cftp="/users/XXXXX/tftp1"
alias bftp="/users/XXXXX/tftp2"
alias tree="cd /auto/c5ksw/XXXXX"
alias cs="/users/XXXXX/mybin/findcs"
#alias lftp="/users/XXXXX/tftp"
#alias cftp="/users/XXXXX/tftp1"
#alias nftp="/users/XXXXX/tftp2"
alias gftp="/users/XXXXX/tftp"
#
# Build cscope files
#
alias csf='rm cscope.files; find . -name \*.\[ch\] -print | grep -v nmpboot | grep -v rommon >cscope.files'
alias ws="cd /ws/XXXXX/"
stty erase ^H
set hostname=`uname -n`
alias setprompt='set prompt="\\
${hostname}:${cwd}\\
\! % "'
alias cd='chdir \!* && setprompt'
setprompt # sets the actual prompt
source /sw/packages/ccache/current/bin/setup-ccache
export SR_MGR_CONF_DIR
SR_MGR_CONF_DIR=~XXXXX/bin
if ( $?MAIL != 0 ) then
set mail=( $MAIL ) # mail spool
endif
# Local Variables:
# mode:shell-script
# sh-shell:bash
# End:
I used this script for my .bashrc file btu it showed an error that
bash: ./.bashrc: line 153: syntax error: unexpected end of file
Could someone please help me regarding this.............
- 05-07-2008 #2Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
Is that the whole file? It's only 98 lines long.
- 05-07-2008 #3Just Joined!
- Join Date
- Dec 2006
- Posts
- 52
2 things. First to answer your question, if tests end in fi not endif for bash. endif is a C shell syntax. Second, you need to set your environment before you export it:
EDITOR=vim # Preferred editor.
export EDITOR
NOT:
export EDITOR
EDITOR=vim # Preferred editor.
John
- 05-07-2008 #4Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
This bashrc is a mess. If you don't understand what it does, you probably don't need such a bashrc file.
Why are you trying to do on first place?
If you have a specific need or problem, just let us know and we can help to design a basic rc file to solve that. But just throwing a +150 lines script into your home without knowing what even it does is not a good idea at all.
- 05-08-2008 #5Just Joined!
- Join Date
- May 2008
- Posts
- 14
Hi All
Actually i never worked on BASH i always worked on CSH, So i was having a csh rc file and i tried converting it to .bashrc file.
So i got the problem.
And i know what this file does.
And for the first reply ! "Mr. I am having 257 lines in bashrc file but some of the lines are not meant to be disclosed."
I am working for Cisco and those lines were containing some paths some router ip addresses, Release numbers and so on.
Sorry for that!
So
Ok i got one answer that is
If ends with Fi.
But i am not satisfied with the second answer that says :
export is to be used after we set the value.
Buddy it is working fine for me in both the cases.
Don't know how?
So do u think that "if" is the one who is making my file to give an error: Unexpected end of file?
Ok thanks for your support, I am trying to resolve it.
- 05-08-2008 #6Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
Well, we did not know that.
Yep. "man bash" is your friend.Ok i got one answer that is
If ends with Fi.
Actually, it's the same. Again, man bash. It's all crystal clear there:But i am not satisfied with the second answer that says :
export is to be used after we set the value.
Buddy it is working fine for me in both the cases.
Don't know how?
"export" itself doesn't export anything. It only "marks" vars, functions and the like, and the shell is the one that exports them when forking.
Originally Posted by man bash
Well, you have an unfinished construction, and the error says that the file is ending prematurely... so I'd say: yes.So do u think that "if" is the one who is making my file to give an error: Unexpected end of file?
- 05-08-2008 #7Just Joined!
- Join Date
- May 2008
- Posts
- 14
- 05-10-2008 #8Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
Another common cause of premature end of file messages (IME) is a missing quote, which can be hard to find!
- 05-10-2008 #9Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
- 05-13-2008 #10Just Joined!
- Join Date
- May 2008
- Posts
- 14




