Back to article

Find all the configuration scripts on a system

With this handy perl oneliner

October 30, 1999

perl -l -e'for ( split /:/, $ENV{'PATH'} ) { chdir $_; @a=(<*setup>, <*config>); @a && print "@a"; }'

There are lots of configure and setup programs;
this gives you a clue as to what is on the drive.

In case you don't speak Perl, the split command chops up the PATH variable, the chdir then switches directory to each element of PATH in turn. @a is a list variable and it gets set to the values of the shell globs *setup and *config. Finally, the @a list is printed in double quotes to interpolate it to a space separated string.