Leser: 1
|< 1 2 >| | 12 Einträge, 2 Seiten |
perl -e'print $ENV{PWD};'
Quote$ cat test.pl
#! /usr/local/bin/perl
print "$0\n";
$ perl test.pl
test.pl
$ ./test.pl
./test.pl
$ perl -e 'print "$0\n"'
-e
Quote\n\n$PROGRAM_NAME
$0 Contains the name of the program being executed. On
some operating systems assigning to $0 modifies the
argument area that the ps program sees. This is
more useful as a way of indicating the current
program state than it is for hiding the program
you're running. (Mnemonic: same as sh and ksh.)
Note for BSD users: setting $0 does not completely
remove "perl" from the ps(1) output. For example,
setting $0 to "foobar" will result in "perl: foobar
(perl)". This is an operating system feature.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
C:\Shared\Entwicklung\perl>uedit32 test.pl
C:\Shared\Entwicklung\perl>test.pl
C:\Shared\Entwicklung\perl\test.pl
C:\Shared\Entwicklung\perl>cd..
C:\Shared\Entwicklung>perl\test.pl
C:\Shared\Entwicklung\perl\test.pl
C:\Shared\Entwicklung>perl perl\test.pl
perl\test.pl
C:\Shared\Entwicklung>cd perl
C:\Shared\Entwicklung\perl>test.pl
C:\Shared\Entwicklung\perl\test.pl
C:\Shared\Entwicklung\perl>perl test.pl
test.pl
C:\Shared\Entwicklung\perl>perl ..\perl\test.pl
..\perl\test.pl
C:\Shared\Entwicklung\perl>
|< 1 2 >| | 12 Einträge, 2 Seiten |