Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Open a random file in the GUI via a bash script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Open a random file in the GUI via a bash script
Authored by: barretpj on Nov 14, '05 07:22:02AM
This would work, using -o for OR:

find $WritingsPath -iregex ".*.txt" -o -iregex ".*.rtf" -o -iregex ".*.doc" > $TempLog
NB you should escape the extension dot, otherwise the regexp will interpret . as "any character", so ".*.doc" match a file called "postdoc". Better still, use -iname:

find $WritingsPath -iname "*.txt" -o -iname "*.rtf" -o -iname "*.doc" > $TempLog


[ Reply to This | # ]