Hello Monks,
I have 26 cisco switch dumps. These are large files with close to a million files each. I tried opening individual files and reading them. But it is extremely slow. Ended up using Unix grep instead, which is fast.
Here is my code.
my $hba_alias = `grep $host_hi $switchdir/*.swc|grep ": device-alias"|head -1`;`At some places I am grepping individual files like this
my $hba_swport = `grep $hba_wwn $switchdir/$switchfqdn|grep "^fc"|head -1`I want to grep without opening the files which is lot faster and also I can get away from using unix commands. Any ideas how can I accomplish this ?
TIA
-Shynee
In reply to grep equivalent in perl by shynee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |