On Thu, May 11, 2006 at 02:40:14PM -0500, Doug Poland wrote:
> Hello,
> 
> Can someone point me to a good on-line reference for Bourne shell
> scripting?  I've come across some syntax I don't understand and, since
> I don't understand it, don't know how to search the web for it.
> 
> For example, what do these special variable characters do?
> 
> ${UNISON_SCHED%% *}      #  what does %% * do?
> ${UNISON_JOB%\.*}        #  what does %\.* do?

The man page is a good start ;-)

Here's what is has to say about your questions:

     ${parameter%word}
         Remove Smallest Suffix Pattern.  The word is expanded to produce
         a pattern.  The parameter expansion then results in parameter,
         with the smallest portion of the suffix matched by the pattern
         deleted.

     ${parameter%%word}
         Remove Largest Suffix Pattern.  The word is expanded to produce a
         pattern.  The parameter expansion then results in parameter, with
         the largest portion of the suffix matched by the pattern deleted.

In the second case, '\.*' is a shell file glob pattern.

You might also find this site interesting/useful:

http://www.shelldorado.com/

HTH

Dan

-- 
Daniel Bye

PGP Key: http://www.slightlystrange.org/pgpkey-dan.asc
PGP Key fingerprint: D349 B109 0EB8 2554 4D75  B79A 8B17 F97C 1622 166A
                                                                     _
                                              ASCII ribbon campaign ( )
                                         - against HTML, vCards and  X
                                - proprietary attachments in e-mail / \

Attachment: pgp5EqRu1kU9g.pgp
Description: PGP signature

Reply via email to