February 17, 2019

Find all the configuration scripts on a system

With this handy perl oneliner

  • October 30, 1999
  • By James Andrews
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.

Most Popular LinuxPlanet Stories