-
Notifications
You must be signed in to change notification settings - Fork 0
ApoorvSaxena/Searching
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Create a ruby program which will accept a string of text as an input from command line and search for the pattern in current working directory. There can be any level of subdirectories in current directory. You can choose to use grep or implement your own text search in ruby. Output should be in the following form (all names used here are fictional). ./foo_search.rb "foobar" File ./a/b/c/a.rb : 10 File ./c/g/t/foo.js : 20 File ./aaa.rb : 30 When correct parameters are not supplied in the command line, program should read input from the user. Output: (At my machine) On using the Search String as : "a" apoorv@My-Machine:~/Adomado$ ruby Solution.rb "a" "File: /home/apoorv/Adomado/Solution.rb : 36" "File: /home/apoorv/Adomado/2/1/2/3/Testfile.txt : 5" "File: /home/apoorv/Adomado/2/1/2/Testfile.txt : 5" "File: /home/apoorv/Adomado/2/1/Testfile.txt : 5" "File: /home/apoorv/Adomado/2/3/Testfile.txt : 5" "File: /home/apoorv/Adomado/2/Testfile.txt : 5" "File: /home/apoorv/Adomado/1/2/3/Testfile.txt : 5" "File: /home/apoorv/Adomado/1/2/Testfile.txt : 5" "File: /home/apoorv/Adomado/1/Testfile.txt : 5" "File: /home/apoorv/Adomado/Question : 34"
About
Ruby Script implemented to searching text in files....
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published