Quote:
Originally Posted by KittyWu
Hi,
you can do it without any function call by using the Pattern-matching operators (which are faster).
for instance:
me@host> BackupLocation='abc/dfg'
me@host> SubDir=${BackupLocation##*/}
me@host> echo ${SubDir}
dfg
me@host> BackupLocation=${BackupLocation}/${SubDir}$(date +%w)
me@host> echo ${BackupLocation}
abc/dfg/dfg5
(see 'KornShell/Pattern-matching Operators',
[Chapter 4] 4.3 String Operators)
Hope it helps,
Christophe
|
You may not be aware that the link you posted is in all probability a pirated copy of the material it references. O'Reilly & Associates never gives permission, that I am aware of, to publish their copyrighted materials. Out of respect to them you may consider not posting a link to that piratated material in the future. This website probably does not allow it either, as no legitimate website allows links to pirated material.
You would think the administrator of a major institution of higher learning would know better than to upload copyrighted material to the school server and allow it to be accessed via the www.