AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
#Operatingsystems
#Servers
 View Only
  • 1.  ksh pattern wanted

    Posted 05/26/14 02:44 PM

    Originally posted by: JoachimB


    I'm looking for a pattern that would match any file or directory except '.' and '..'

    So e.g. it should return:

    test

    .test

    t

    test_test

    etc

    Any ideas? Thanks ...

    I want to use it on a chown -R command and want to avoid it to run into '.' and '..'.


    #AIX-Forum


  • 2.  Re: ksh pattern wanted

    Posted 05/27/14 09:34 AM

    Originally posted by: Wouter Liefting


    That would be * .[!.]*

    The first star matches all filenames that are not hidden. The second stanza matches all hidden files of two characters or more (including the leading dot), where the second character is not a dot.


    #AIX-Forum


  • 3.  Re: ksh pattern wanted

    Posted 05/27/14 11:44 AM

    Originally posted by: JoachimB


    Brilliant, thank you!

    Unfortunately I don't understand that two stanzas can be stringed together and that this is interpreted as "match a or b".

    Can't find any word about this in David G. Korn's "The new Kornshell" (my ksh bible).

     


    #AIX-Forum