Today I was try to pass some paramters to my CGI script directly from command line. I have a bash file which execute some perl commands and I need it to be configurable.
Bellow are two examples of how to read command line parameters, first is with Bash and second one is with Perl:
1. Read command line parameters with Bash
#!/bin/bashecho “$# parameters”
echo “$@”;
2. Read command line parameters with Perl
#!/usr/bin/perl foreach $argnum (0 .. $#ARGV) { print “$ARGV[$argnum]n”; }That's it!