Hi,
I created a very basic Perl script that can grep item inside a file and display the result on the screen.
[blue]Fruits.txt[/blue] contains these lines:
apple
banana
cherry
If I use "grep -i" in Unix it works. How can I use that option in my script? Sorry this question is very basic.
Regards
viadisky
I created a very basic Perl script that can grep item inside a file and display the result on the screen.
Code:
#!C:\Perl\bin\perl.exe
open (FILE, '<Fruits.txt')or die "$!\n";
@array = <FILE>;
@result = grep (/apple/, @array);
print @result;
close (FILE);
[blue]Fruits.txt[/blue] contains these lines:
apple
banana
cherry
If I use "grep -i" in Unix it works. How can I use that option in my script? Sorry this question is very basic.
Regards
viadisky