From: Josef 'Jupp' Schugt Date: 2003-09-26T05:17:52+09:00 Subject: Re: formatting ruby code in html Hi! * Ara.T.Howard; 2003-09-25, 12:57 UTC: > for f in *.[rb]; do > gvim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" $f; > done The line breaks I inserted don't break anything else but lines. '*.[rb]' matches file names that either end in '.r' or in '.r'. I think you want to match all files with names ending in '.rb'. This is done as follows: for f in *.rb That still doesn't solve the problem at hand. The task is not to identify files with names ending in certain characters but identifying files with certain content. This problem can be solved in two stages by first identifying the names of all files (in contrast to directories and other things) and then finding out which of these files are ruby programs: for f in $(file $(find . -type f)|grep -i ruby|cut -d : -f1); do "$(...)" is the POSIX equivalent of "`...`" that has a major advantage over the latter form: It can easily be nested. There is good reason to insist on *not* mixing up file extensions with file types. Under Unix and Linux programs may not have any file extension while still being written in Ruby. Also note that by +"colorscheme " to +"syntax on" you can use a different color scheme for syntax highlighting than Please take notice of signature! / Bitte Signature beachten! Josef 'Jupp' Schugt -- *Warning!* For sending me messages > 100 kB you need my explicit permission. Otherwise they will be silently discarded. *Vorsicht!* Mails > 100 KB nehme ich nur nach vorheriger Absprache entgegen. Ohne eine solche Absprache werden sie ungelesen geloescht.