Variables from the shell are available in Perl’s %ENV
hash. With bash
(and some other shells) you need to take the extra step of “exporting” your shell variable so it is visible to subprocesses.
mydate=10/10/2012
export mydate
perl -e 'print "my date is $ENV{mydate}\n"'
More Related Contents:
- How can I quickly sum all numbers in a file?
- how to print n words of context while searching text [closed]
- Iterating through a CSV and pulling out the last line of the day for each element
- sh: 1: Syntax error: "(" unexpected error
- replacing a placeholder in a html file with 1-n specific values defined in a config.json using shellscript [closed]
- How can I match values in one file to ranges from another?
- Sort words and then the sentence including digits and characters in Shell scripting or perl scripting [closed]
- Convert Bash script to Perl/VBS/any other windows compatible language [closed]
- How can I manipulate text in bash? [closed]
- Awk – replace coumn 2 in table 1 from coumn 2 in table 2 based on matching data in column 1 (common between tables)
- How do I use shell variables in an awk script?
- How to print lines between two patterns, inclusive or exclusive (in sed, AWK or Perl)?
- Bash tool to get nth line from a file
- Fastest way to find lines of a file from another larger file in Bash
- How can I delete a newline if it is the last character in a file?
- How to make awk ignore the field delimiter inside double quotes? [duplicate]
- How to match a pattern given in a variable in awk?
- How to extrace pg_backend_pid from postgresql in shell script and pass it to another process?
- Insert multiple lines into a file after specified pattern using shell script
- How can I trim white space from a variable in awk?
- how to delete the duplicate lines in file except the first matched line
- How can I escape an arbitrary string for use as a command line argument in Bash?
- How to strip out all of the links of an HTML file in Bash or grep or batch and store them in a text file
- Print lines from one file that are not contained in another file
- Parse HTML using shell
- Explain the deviousness of the Perl “preamble”
- How to grep for case insensitive string in a file?
- Converting relative path into absolute path?
- Generating permutations using bash
- Running shell script in parallel