![]() With a small script, you can traverse directory tree, push files that contain the desired string into array, and then print it like so: #!/usr/bin/env perlĪnd how it works: $. ![]() ![]() Perl has Find module, which allows to perform recursive traversal of directory tree, and via subroutine perform specific action on them. **/* expansion is a file and whether it contains the desired text: bash-4.3$ for f in. All we need to do is test for whether item in the. bashīash has a very nice globstar shell option, which allows for recursive traversal of the directory tree. ![]() While find command is simplest way to recursively traverse the directory tree, there are other ways and in particular the two scripting languages that come with Ubuntu by default already have the ability to do so. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |