Filename Substitution

   

Korn Shell: Unix and Linux Programming Manual, Third Edition, The
By Anatole Olczak

Table of Contents
Appendix G.  Pdksh Quick Reference


File name substitution is a feature which allows special characters and patterns to substituted with file names in the current directory, or arguments to the case and [[...]] commands.

Pattern-Matching Characters/Patterns

?

match any single character

*

match zero or more characters, including null

[abc]

match any characters between the brackets

[x z]

match any characters in the range x to z

[a ce g]

match any characters in the range a to c, e to g

[!abc]

match any characters not between the brackets

[!x z]

match any characters not in the range x to z

.

strings starting with '.' must be explicitly matched

?(pattern-list)

match zero or one occurrence of any pattern

*(pattern-list)

match zero or more occurrences of any pattern

+(pattern-list)

match one or more occurrence of any pattern

@(pattern-list)

match exactly one occurrence of any pattern

!(pattern-list)

match anything except any pattern

pattern-list

multiple patterns must be separated with a '|' character


       
    Top
     



    Korn Shell. Unix and Linux Programming Manual, Third Edition
    Korn Shell. Unix and Linux Programming Manual, Third Edition
    ISBN: N/A
    EAN: N/A
    Year: 2000
    Pages: 177

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net