I am a new learner in scripting languages. I want to display all the .conf files in the computer using ruby. I have written the below code, however, its not printing anything.
Dir.glob("**/*.conf") {|file| puts file}
What am I doing wrong?
I am a new learner in scripting languages. I want to display all the .conf files in the computer using ruby. I have written the below code, however, its not printing anything.
Dir.glob("**/*.conf") {|file| puts file}
What am I doing wrong?
You're almost there. Your code will show you all the conf files, but it will start checking in the folder where you're currently located, not the whole computer. To achieve that, try with:
Dir.glob("/**/*.conf") {|file| puts file}