File: printenv

package info (click to toggle)
apache2 2.2.9-10%2Blenny12
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 37,556 kB
  • ctags: 20,182
  • sloc: ansic: 221,847; sh: 20,216; perl: 2,094; makefile: 1,251; awk: 1,124; pascal: 513; lex: 191; python: 136; yacc: 100
file content (13 lines) | stat: -rw-r--r-- 294 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/local/bin/perl
##
##  printenv -- demo CGI program which just prints its environment
##

print "Content-type: text/plain; charset=iso-8859-1\n\n";
foreach $var (sort(keys(%ENV))) {
    $val = $ENV{$var};
    $val =~ s|\n|\\n|g;
    $val =~ s|"|\\"|g;
    print "${var}=\"${val}\"\n";
}