basic bashrc question
Hi folks,
first time poster, long time reader.
im goofing around with the shell/scripting tutorials from linuxcommand.org and im getting a syntax error that i dont understand. was hoping for some insight.
the lesson:
Aliases are good for very simple commands, but if you want to create something more complex, you should try shell functions. Shell functions can be thought of as "scripts within scripts" or little sub-scripts. Let's try one. Open .bashrc with your text editor again and replace the alias for "today" with the following:
function today {
echo "Today's date is:"
date +"%A, %B %-d, %Y"
}
the file:
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
alias l='ls -l'
function today {
> echo "Today's date is:"
> date +"%A, %B %-d, %Y"
> }
~
~
~
~
~
~
~
~
".bashrc" 15L, 214C 15,1 All
the error:
bash: /home/people/.bashrc: line 16: syntax error: unexpected end of file
any thoughts?
thanks,
jerf
|