--- Patrick O'Callaghan <pocallaghan@xxxxxxxxx> wrote: > On Sun, 2008-04-06 at 18:34 -0700, Bruce Hyatt wrote: > > This is stretching my knowledge of bash. The main point > about > > which I'm not sure is the brackets([]). > > > > I'm accustomed to these being used for optional parts of a > > command but the apostrophe before and after the brackets > makes > > me wonder. Plus the fact that brackets are used for > "filename > > metacharacters" which it appears could be the case here. > > > > Should I enter the brackets as part of the command? > > Yes. In fact you can learn a lot by figuring it out. Take it > one step at > a time: > > rpm -qa --qf '[\[ -L %{FILENAMES:shescape} \] || chmod > %7.7{FILEMODES:octal} %{FILENAMES:shescape}\n]' > A------------^ > B--------------^ > > A: This bracket and its matching pair mean "for each filename > in the > package" (special rpm query syntax, > see /usr/share/doc/rpm-4.4.2.2/queryformat). > > B: This will be printed in the output, and is the Shell "test" > builtin. > '-L' means "symbolic link", and '||' is of course the > sequential 'or' > operator. > > So this part of the incantation means "for each filename in > the package > which is not a symbolic link, change the permissions to ..." > > etc. > > poc > Yeah, that's what I did. I could get the general idea that it's looking through rpm database to compare file permissions to the original permissions, changing them and printing them to the terminal. Trying to follow the character escapes makes my brain fog in though. I also couldn't follow the rpm query syntax. I wasn't aware of the existence of queryformat file. I'll have to look at it. Thanks again, Bruce ____________________________________________________________________________________ You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com -- fedora-list mailing list fedora-list@xxxxxxxxxx To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list