$base will hold the literal string basename $dir . Is that what you want? I'd guess "command substitution" would be more like what you need. Did you look into dirname ?
There are several quotes to consider and their uses vary. Usually in sh/ksh/bash scripts:-
" - Double quotes wrap a string, preserving spaces in variables, and allow the shell to work with meta-characters with the string, so variables get expanded, escaped characters have their special meaning etc. This is allowing what is known as interpolation.
' - Single quotes wrap a string, preserving everything as literal text, so there is no interpolation.
` - Back-quote or Back-tick is common for command substitution, as in result=`command` although aparently this is to be discouraged. I'm not sure the reasons why but I'm told that this is the preferred format - result=$(command)
There are similarly important rules for the variety of brackets, ( , [ , < , { and their appropriate opposites and a preceding $ can cause them to do yet more things.
doesnt work, this is what i get when i run the script
[root@robw-linux /]# bash -x test.sh
+ base=
+ echo 'is this archive for an audio tar (press 1) or an audio directory (press 2)'
is this archive for an audio tar (press 1) or an audio directory (press 2)
+ read method
2
+ case $method in
+ echo 'please specify full path to directory you want to be made into a tar'
please specify full path to directory you want to be made into a tar
+ read -e dir
/to_be_archived/robstest/
+ echo 'please enter ID number ie ID1234'
please enter ID number ie ID1234
+ read id
ID67
+ echo 'please specify where you want the tar file to be stored'
please specify where you want the tar file to be stored
+ read -e dest
/archived_projects/
+ tar -cf ID67_.tar /to_be_archived/robstest/
tar: Removing leading `/' from member names
+ rsync -avh ID67_.tar /archived_projects/
sending incremental file list
ID67_.tar
sent 10.32K bytes received 31 bytes 20.70K bytes/sec
total size is 10.24K speedup is 0.99
+ rm -f ID67_.tar
+ rm -rf /to_be_archived/robstest/