I think you need to expand a bit; what you've written doesn't make sense to me.
You seem to be typing cmds that would be better typed into the cmd line direct, not into the vi editor, which is used for creating shell progs.
Let me guess...
To create a shell prog to do backups,
Code:
# this cmd creates the file named and opens it in vi/vim
vi mybackup.sh
# now you would add the cmds that actually do the backup
....
Code:
# this is done after exiting from the file above
# ie back in cli
chmod u+x backup
./backup
These should help
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
HTH & Welcome to LQ
http://www.tldp.org/LDP/abs/html/