Not a one-liner and not even pretty, but since I needed the practice:
---------------------
#! /usr/bin/perl
use File::Find;
@l = ( "/" );
sub w
{
if ( -d $_ )
{ my $dir = $File::Find::dir;
if ( system( "file * | grep perl" ) == 0 )
{ print "*** from: $dir ***\n";
}
}
}
find( \&w, @l );
---------------------
Overkill.
Gets a lot of "can't cd errors, of course, since I'm not running it as
root, and it takes a while to run, too.
Finds a bit more than scripts, too, so it really doesn't serve the
original question, Heh.
A bunch of people wrote
Are there OS functions that rely on perl? What sorts of things?
Yes. Not many, though. You can see what's there if you type
$ locate *.pl
in a terminal window.
That will only show the files ending in .pl. Scripts use the #! line
to determine the interpreter to run them with, not the filename
extension.
I was thinking, let's write a script to check the first lines. But I'm
lazy.
file /*bin/* | grep perl
file /usr/*bin/* | grep perl
gets everything in the usual places for system executables. Of course
it misses utility scripts in odd places, including all those found by
the "locate *.pl" command. Since I'm a little weak with one-liners and
with File::Find, I should try to work up a one-liner that would do a
recursive descent, and log out and back in as a user that can sudo so
I can descend all the places my working user can't.
But I'm lazy. ;-/