Hi,
Quote:
what is the use of ${scriptdir}?
|
$scriptdir and ${scriptdir} are basically the same, but sometimes you need the curly braces to do some bash related stuff (man bash -> Parameter Expansion).
I made it a habit to always use the curly braces.
Here's another reason why you need to use culry braces:
dirpart="/x/y/z/"
file1=${dirpart}somename.datestamp.extension
file2=$dirpartsomename.datestamp.extension
file1 will be what you wanted (=> /x/y/z/somename.datestamp.extension)
file2 will be empty, there's no variable called dirpartsomename.datestamp.extension.
Quote:
tar: Removing leading `/' from member names
|
This is tar's default behavior. Without the leading /, it is possible to extract the archive at any location and select yourself what file(s) needs to be restored. If the leading slash is not removed, untarring will overwrite the files that are already there (which could be good, but is a bad thing most of the time).
The -p / --absolute-names option will make sure that the leading / won't be removed (only use this if you know what the consequences are....)
Hope this helps.