smdaziz / linux-file-parser

Demonstration of reading a delimited file and calling a perl/shell script in Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

linux-file-parser

Demonstration of reading a delimited file and calling a perl/shell script in Linux

Instructions to Run/Execute

Option #1 - Clone the repo/checkout the code

Option #2 - Download the files file_reader.sh, perl_script.pl, server_path.txt

File Descriptions

  • server_path.txt - contains the delimited dummy server IPs and some fake paths
  • perl_script.pl - is the sample perl that takes and does the actual processing with the passed in serverIP and the path
    Note: in this example, I'm just printing the received serverIP and the path
  • file_reader.sh - is the main file to RUN, that takes in server_path.txt as the argument, reads the content and invokes perl_script.pl for each entry

Command to RUN

sh file_reader.sh server_path.txt

About

Demonstration of reading a delimited file and calling a perl/shell script in Linux


Languages

Language:Perl 41.4%Language:Shell 34.0%Language:JavaScript 24.7%