- ANSI C
- PERL
- » Variable handling
- » Miscellaneous
- » POSIX
- » Date/Time
- » Math
- » menu_code_perlcode_strings
- » PCRE
- » Arrays
- » Classes
- » Program execution
- » Directories
- » Filesystem
- » GD
- » Network
- » Sockets
- » DBI
- PHP
- JavaScript
CONTENT
- CHANGES
Szukaj
#top POSIX¶
code / perl / POSIX
#top Predefined Constants¶
No Predefined Constants here.
#top Datatypes / MACROS¶
No Datatypes here.
#top POSIX Functions¶
#top endgrent¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
endgrent()
jest następująca:endgrent
Powiązane:
endgrent(), getgrent(), setgrent(),
Opis:
description
#top endpwent¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
endpwent()
jest następująca:endpwent
Powiązane:
endpwent(), getpwent(), setpwent(),
Opis:
description
#top getegid¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
getegid()
jest następująca:getegid
Powiązane:
getegid(), geteuid(), getgid(), getpid(), getppid(), getuid(),
Opis:
description
#top geteuid¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
geteuid()
jest następująca:geteuid
Powiązane:
getegid(), geteuid(), getgid(), getpid(), getppid(), getuid(),
Opis:
description
#top getgid¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
getgid()
jest następująca:getgid
Powiązane:
getegid(), geteuid(), getgid(), getpid(), getppid(), getuid(),
Opis:
description
#top getgrent¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
getgrent()
jest następująca:getgrent
Powiązane:
endgrent(), getgrent(), setgrent(),
Opis:
description
Example:
zawartość pliku
getgrent.pl
SELECT ALL
#!/usr/bin/perl -w use strict; # force definations for all vars an subroutines use warnings; # force check of unset variables in expressions use diagnostics; # give var/code line number on faults my ($name, $passwd, $gid, $members); if ($#ARGV+1<0) { print("Usage: $0\n"); exit(1); } setgrent(); while (1) { ($name, $passwd, $gid, $members)=getgrent(); if (!defined($name)) { last; } printf(""$0: (\$name, \$passwd, \$gid, \$members)=getgrent(): \$name=$name \$passwd=$passwd \$gid=$gid \$members=$members\n"); } endgrent();
Aby zobaczyć jak działa program należy go uruchomić bez argumentów:
/home/local/code/perlcode/posix/getgrent.plprogram wyświetli stosowne informacje o sposobie działania:
/home/local/code/perlcode/posix/getgrent.pl: ($name, $passwd, $gid, $members)=getgrent(): $name=root $passwd=x $gid=0 $members=root /home/local/code/perlcode/posix/getgrent.pl: ($name, $passwd, $gid, $members)=getgrent(): $name=bin $passwd=x $gid=1 $members=root bin daemon /home/local/code/perlcode/posix/getgrent.pl: ($name, $passwd, $gid, $members)=getgrent(): $name=daemon $passwd=x $gid=2 $members=root bin daemon /home/local/code/perlcode/posix/getgrent.pl: ($name, $passwd, $gid, $members)=getgrent(): $name=sys $passwd=x $gid=3 $members=root bin adm /home/local/code/perlcode/posix/getgrent.pl: ($name, $passwd, $gid, $members)=getgrent(): $name=adm $passwd=x $gid=4 $members=root adm daemon [...]
#top getgrnam¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
getgrnam()
jest następująca:getgrnam
Powiązane:
getgrnam(), getpwnam(),
Opis:
description
Example:
zawartość pliku
getgrnam.pl
SELECT ALL
#!/usr/bin/perl -w use strict; # force definations for all vars an subroutines use warnings; # force check of unset variables in expressions use diagnostics; # give var/code line number on faults my ($groupname); my ($name, $passwd, $gid, $members); if ($#ARGV+1<1) { print("Usage: $0 <username>\n"); print("Examples:\n"); print(" $0 root\n"); print(" $0 bin\n"); print(" $0 daemon\n"); print(" $0 adm\n"); exit(1); } $groupname=$ARGV[0]; ($name, $passwd, $gid, $members) = getgrnam($groupname); if (defined($name)) { printf(""$0: (\$name, \$passwd, \$gid, \$members)=getgrnam($groupname): if (defined(\$name)): \$name=$name \$passwd=$passwd \$gid=$gid \$members=$members\n"); }else { printf(""$0: (\$name, \$passwd, \$gid, \$members)=getgrnam($groupname): if (defined(\$name)): else: Entry '$groupname' does not exists!\n"); }
Aby zobaczyć jak działa program należy go uruchomić bez argumentów:
/home/local/code/perlcode/posix/getgrnam.plprogram wyświetli informacje o sposobie uruchamiania programu:
Usage: /home/local/code/perlcode/posix/getgrnam.pl <username> Examples: /home/local/code/perlcode/posix/getgrnam.pl root /home/local/code/perlcode/posix/getgrnam.pl bin /home/local/code/perlcode/posix/getgrnam.pl daemon /home/local/code/perlcode/posix/getgrnam.pl adm
jako argument wywołania programu można podać analogiczne jak poniżej argumenty:
/home/local/code/perlcode/posix/getgrnam.pl root /home/local/code/perlcode/posix/getgrnam.pl bin /home/local/code/perlcode/posix/getgrnam.pl daemon /home/local/code/perlcode/posix/getgrnam.pl adm /home/local/code/perlcode/posix/getgrnam.pl rootarezultat będzie zależny od podanego argumentu wywołania programu:
/home/local/code/perlcode/posix/getgrnam.pl: ($name, $passwd, $gid, $members)=getgrnam(root): if (defined($name)): $name=root $passwd=x $gid=0 $members=root /home/local/code/perlcode/posix/getgrnam.pl: ($name, $passwd, $gid, $members)=getgrnam(bin): if (defined($name)): $name=bin $passwd=x $gid=1 $members=root bin daemon /home/local/code/perlcode/posix/getgrnam.pl: ($name, $passwd, $gid, $members)=getgrnam(daemon): if (defined($name)): $name=daemon $passwd=x $gid=2 $members=root bin daemon /home/local/code/perlcode/posix/getgrnam.pl: ($name, $passwd, $gid, $members)=getgrnam(adm): if (defined($name)): $name=adm $passwd=x $gid=4 $members=root adm daemon user sp /home/local/code/perlcode/posix/getgrnam.pl: ($name, $passwd, $gid, $members)=getgrnam(roota): if (defined($name)): else: Entry 'roota' does not exists!
#top getlogin¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
getlogin()
jest następująca:getlogin
Powiązane:
Opis:
description
Example:
zawartość pliku
getlogin.pl
SELECT ALL
#!/usr/bin/perl -w use strict; # force definations for all vars an subroutines use warnings; # force check of unset variables in expressions use diagnostics; # give var/code line number on faults use POSIX; my ($mylogin); if ($#ARGV+1<0) { print("Usage: $0\n"); exit(1); } $mylogin=getlogin(); print""$0: \$mylogin=getlogin(): \$mylogin=$mylogin\n");
Aby zobaczyć jak działa program należy go uruchomić bez argumentów:
/home/local/code/perlcode/posix/getlogin.plprogram wyświetli stosowne informacje o sposobie działania:
/home/local/code/perlcode/posix/getlogin.pl: $mylogin=getlogin(): $mylogin=user
#top getpid¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
getpid()
jest następująca:getpid
Powiązane:
getegid(), geteuid(), getgid(), getpid(), getppid(), getuid(),
Opis:
description
#top getppid¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
getppid()
jest następująca:getppid
Powiązane:
getegid(), geteuid(), getgid(), getpid(), getppid(), getuid(),
Opis:
description
#top getpwent¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
getpwent()
jest następująca:getpwent
Powiązane:
endpwent(), getpwent(), setpwent(),
Opis:
description
Example:
zawartość pliku
getpwent.pl
SELECT ALL
#!/usr/bin/perl -w use strict; # force definations for all vars an subroutines use warnings; # force check of unset variables in expressions use diagnostics; # give var/code line number on faults my ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell); if ($#ARGV+1<0) { print("Usage: $0\n"); exit(1); } setpwent(); while (1) { ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwent(); if (!defined($name)) { last; } printf(""$0: (\$name, \$passwd, \$uid, \$gid, \$quota, \$comment, \$gcos, \$dir, \$shell) = getpwent(): \$name=$name, \$passwd=$passwd, \$uid=$uid, \$gid=$gid, \$quota=$quota, \$comment=$comment, \$gcos=$gcos, \$dir=$dir, \$shell=$shell\n"); } endpwent();
Aby zobaczyć jak działa program należy go uruchomić bez argumentów:
/home/local/code/perlcode/posix/getpwent.plprogram wyświetli stosowne informacje o sposobie działania:
/home/local/code/perlcode/posix/getpwent.pl: ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwent(): $name=root, $passwd=x, $uid=0, $gid=0, $quota=, $comment=, $gcos=root, $dir=/root, $shell=/bin/bash /home/local/code/perlcode/posix/getpwent.pl: ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwent(): $name=bin, $passwd=x, $uid=1, $gid=1, $quota=, $comment=, $gcos=bin, $dir=/bin, $shell=/sbin/nologin /home/local/code/perlcode/posix/getpwent.pl: ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwent(): $name=daemon, $passwd=x, $uid=2, $gid=2, $quota=, $comment=, $gcos=daemon, $dir=/sbin, $shell=/sbin/nologin /home/local/code/perlcode/posix/getpwent.pl: ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwent(): $name=adm, $passwd=x, $uid=3, $gid=4, $quota=, $comment=, $gcos=adm, $dir=/var/adm, $shell=/sbin/nologin [...]
#top getpwnam¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
getpwnam()
jest następująca:getpwnam
Powiązane:
getgrnam(), getpwnam(),
Opis:
description
Example:
zawartość pliku
getpwnam.pl
SELECT ALL
#!/usr/bin/perl -w use strict; # force definations for all vars an subroutines use warnings; # force check of unset variables in expressions use diagnostics; # give var/code line number on faults my ($username); my ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell); if ($#ARGV+1<1) { print("Usage: $0 <username>\n"); print("Examples:\n"); print(" $0 root\n"); print(" $0 bin\n"); print(" $0 daemon\n"); print(" $0 adm\n"); exit(1); } $username=$ARGV[0]; ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwnam($username); if (defined($name)) { printf(""$0: (\$name, \$passwd, \$uid, \$gid, \$quota, \$comment, \$gcos, \$dir, \$shell) = getpwnam($username): if (defined(\$name)): \$name=$name, \$passwd=$passwd, \$uid=$uid, \$gid=$gid, \$quota=$quota, \$comment=$comment, \$gcos=$gcos, \$dir=$dir, \$shell=$shell\n"); }else { printf(""$0: (\$name, \$passwd, \$uid, \$gid, \$quota, \$comment, \$gcos, \$dir, \$shell) = getpwnam($username): if (defined(\$name)): else: Entry '$username' does not exists!\n"); }
Aby zobaczyć jak działa program należy go uruchomić bez argumentów:
/home/local/code/perlcode/posix/getpwnam.plprogram wyświetli informacje o sposobie uruchamiania programu:
Usage: /home/local/code/perlcode/posix/getpwnam.pl <username> Examples: /home/local/code/perlcode/posix/getpwnam.pl root /home/local/code/perlcode/posix/getpwnam.pl bin /home/local/code/perlcode/posix/getpwnam.pl daemon /home/local/code/perlcode/posix/getpwnam.pl adm
jako argument wywołania programu można podać analogiczne jak poniżej argumenty:
/home/local/code/perlcode/posix/getpwnam.pl root /home/local/code/perlcode/posix/getpwnam.pl bin /home/local/code/perlcode/posix/getpwnam.pl daemon /home/local/code/perlcode/posix/getpwnam.pl adm /home/local/code/perlcode/posix/getpwnam.pl rootarezultat będzie zależny od podanego argumentu wywołania programu:
/home/local/code/perlcode/posix/getpwnam.pl: ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwnam(root): if (defined($name)): $name=root, $passwd=x, $uid=0, $gid=0, $quota=, $comment=, $gcos=root, $dir=/root, $shell=/bin/bash /home/local/code/perlcode/posix/getpwnam.pl: ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwnam(bin): if (defined($name)): $name=bin, $passwd=x, $uid=1, $gid=1, $quota=, $comment=, $gcos=bin, $dir=/bin, $shell=/sbin/nologin /home/local/code/perlcode/posix/getpwnam.pl: ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwnam(daemon): if (defined($name)): $name=daemon, $passwd=x, $uid=2, $gid=2, $quota=, $comment=, $gcos=daemon, $dir=/sbin, $shell=/sbin/nologin /home/local/code/perlcode/posix/getpwnam.pl: ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwnam(adm): if (defined($name)): $name=adm, $passwd=x, $uid=3, $gid=4, $quota=, $comment=, $gcos=adm, $dir=/var/adm, $shell=/sbin/nologin /home/local/code/perlcode/posix/getpwnam.pl: ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwnam(roota): if (defined($name)): else: Entry 'roota' does not exists!
#top getuid¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
getuid()
jest następująca:getuid
Powiązane:
getegid(), geteuid(), getgid(), getpid(), getppid(), getuid(),
Opis:
description
Example:
zawartość pliku
getuid.pl
SELECT ALL
#!/usr/bin/perl -w use strict; # force definations for all vars an subroutines use warnings; # force check of unset variables in expressions use diagnostics; # give var/code line number on faults use POSIX; my ($mypid, $myppid); my ($myuid, $mygid); my ($myeuid, $myegid); if ($#ARGV+1<0) { print("Usage: $0\n"); exit(1); } $mypid=getpid(); $myppid=getppid(); $myuid=getuid(); $mygid=getgid(); $myeuid=geteuid(); $myegid=getegid(); print""$0: \$mypid =getpid(): \$mypid =$mypid\n"); print""$0: \$myppid=getppid(): \$myppid=$myppid\n"); print""$0: \$myuid =getuid(): \$myuid =$myuid\n"); print""$0: \$mygid =getgid(): \$mygid =$mygid\n"); print""$0: \$myeuid=geteuid(): \$myeuid=$myeuid\n"); print""$0: \$myegid=getegid(): \$myegid=$myegid\n");
Aby zobaczyć jak działa program należy go uruchomić bez argumentów:
/home/local/code/perlcode/posix/getuid.plprogram wyświetli stosowne informacje o sposobie działania:
/home/local/code/perlcode/posix/getuid.pl: $mypid =getpid(): $mypid =7516 /home/local/code/perlcode/posix/getuid.pl: $myppid=getppid(): $myppid=6743 /home/local/code/perlcode/posix/getuid.pl: $myuid =getuid(): $myuid =501 /home/local/code/perlcode/posix/getuid.pl: $mygid =getgid(): $mygid =100 /home/local/code/perlcode/posix/getuid.pl: $myeuid=geteuid(): $myeuid=501 /home/local/code/perlcode/posix/getuid.pl: $myegid=getegid(): $myegid=100
#top setgid¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
setgid()
jest następująca:setgid
Powiązane:
setgid(), setuid(),
Opis:
description
#top setgrent¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
setgrent()
jest następująca:setgrent
Powiązane:
endgrent(), getgrent(), setgrent(),
Opis:
description
#top setpwent¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
setpwent()
jest następująca:setpwent
Powiązane:
endpwent(), getpwent(), setpwent(),
Opis:
description
#top setuid¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
setuid()
jest następująca:setuid
Powiązane:
setgid(), setuid(),
Opis:
description
Example:
zawartość pliku
setuid.pl
SELECT ALL
#!/usr/bin/perl -w use strict; # force definations for all vars an subroutines use warnings; # force check of unset variables in expressions use diagnostics; # give var/code line number on faults use POSIX; my ($myuid, $mygid, $result); if ($#ARGV+1<2) { print("Usage: $0 <uid> <gid>\n"); exit(1); } $myuid=int($ARGV[0]); $mygid=int($ARGV[1]); $result=setuid($myuid); if (defined($result)) { printf("$0: \$result=setuid($myuid): if (defined(\$result)): Successful setuid().\n"); } else { printf("$0: \$result=setuid($myuid); if (defined(\$result)): else: Unable to setuid(), Reason: $!\n"); } $result=setgid($mygid); if (defined($result)) { printf("$0: \$result=setgid($mygid): if (defined(\$result)): Successful setgid().\n"); } else { printf("$0: \$result=setgid($mygid); if (defined(\$result)): else: Unable to setgid(), Reason: $!\n"); }
Aby zobaczyć jak działa program należy go uruchomić bez argumentów:
/home/local/code/perlcode/posix/setuid.plprogram wyświetli informacje o sposobie uruchamiania programu:
Usage: /home/local/code/perlcode/posix/setuid.pl <uid> <gid>
jako argument wywołania programu można podać analogiczne jak poniżej argumenty:
/home/local/code/perlcode/posix/setuid.pl 501 100 /home/local/code/perlcode/posix/setuid.pl 501 48 /home/local/code/perlcode/posix/setuid.pl 501 95 /home/local/code/perlcode/posix/setuid.pl 0 100 /home/local/code/perlcode/posix/setuid.pl 0 0 /home/local/code/perlcode/posix/setuid.pl 501 100rezultat będzie zależny od podanego argumentu wywołania programu:
/home/local/code/perlcode/posix/setuid.pl: $result=setuid(501): if (defined($result)): Successful setuid(). /home/local/code/perlcode/posix/setuid.pl: $result=setgid(100): if (defined($result)): Successful setgid(). /home/local/code/perlcode/posix/setuid.pl: $result=setuid(501): if (defined($result)): Successful setuid(). /home/local/code/perlcode/posix/setuid.pl: $result=setgid(48); if (defined($result)): else: Unable to setgid(), Reason: Operacja niedozwolona /home/local/code/perlcode/posix/setuid.pl: $result=setuid(501): if (defined($result)): Successful setuid(). /home/local/code/perlcode/posix/setuid.pl: $result=setgid(95); if (defined($result)): else: Unable to setgid(), Reason: Operacja niedozwolona /home/local/code/perlcode/posix/setuid.pl: $result=setuid(0); if (defined($result)): else: Unable to setuid(), Reason: Operacja niedozwolona /home/local/code/perlcode/posix/setuid.pl: $result=setgid(100): if (defined($result)): Successful setgid(). /home/local/code/perlcode/posix/setuid.pl: $result=setuid(0); if (defined($result)): else: Unable to setuid(), Reason: Operacja niedozwolona /home/local/code/perlcode/posix/setuid.pl: $result=setgid(0); if (defined($result)): else: Unable to setgid(), Reason: Operacja niedozwolona /home/local/code/perlcode/posix/setuid.pl: $result=setuid(501): if (defined($result)): Successful setuid(). /home/local/code/perlcode/posix/setuid.pl: $result=setgid(100): if (defined($result)): Successful setgid().
#top ttyname¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
ttyname()
jest następująca:ttyname
Powiązane:
Opis:
description
Example:
zawartość pliku
ttyname.pl
SELECT ALL
#!/usr/bin/perl -w use strict; # force definations for all vars an subroutines use warnings; # force check of unset variables in expressions use diagnostics; # give var/code line number on faults use POSIX; my ($STDIN_FILENO, $STDOUT_FILENO, $STDERR_FILENO); my ($ttyinfo, $filename, $FPRD, $fileno); if ($#ARGV+1<1) { print("Usage: $0 </path/to/filename>\n"); print("Examples:\n"); print(" $0 /home/local/code/perlcode/posix/ttyname.pl\n"); exit(1); } $STDIN_FILENO =STDIN_FILENO ; $STDOUT_FILENO=STDOUT_FILENO; $STDERR_FILENO=STDERR_FILENO; $filename=$ARGV[0]; $ttyinfo=ttyname(STDIN_FILENO); print""$0: ttyinfo=ttyname(STDIN_FILENO=$STDIN_FILENO): ttyinfo=$ttyinfo\n"); $ttyinfo=ttyname(STDOUT_FILENO); print""$0: ttyinfo=ttyname(STDOUT_FILENO=$STDOUT_FILENO): ttyinfo=$ttyinfo\n"); $ttyinfo=ttyname(STDERR_FILENO); print""$0: ttyinfo=ttyname(STDERR_FILENO=$STDERR_FILENO): ttyinfo=$ttyinfo\n"); if (open($FPRD,$filename)) { printf(""$0: if (open($FPRD,$filename)); Successful opened file '$filename'.\n"); $fileno=fileno($FPRD); $ttyinfo=ttyname($fileno); if (defined($ttyinfo)) { printf("$0: ttyinfo=ttyname($fileno): ttyinfo=$ttyinfo\n"); } else { printf("$0: ttyinfo=ttyname($fileno): else: ttyinfo=UNDEFINED\n"); } close($FPRD); } else { printf(""%s: if (open($FPRD,$filename)); else: Unable to open file '$filename', Reason: $!\n"); }
Aby zobaczyć jak działa program należy go uruchomić bez argumentów:
/home/local/code/perlcode/posix/ttyname.plprogram wyświetli informacje o sposobie uruchamiania programu:
Usage: /home/local/code/perlcode/posix/ttyname.pl </path/to/filename>
jako argument wywołania programu można podać analogiczne jak poniżej argumenty:
/home/local/code/perlcode/posix/ttyname.pl /home/local/code/perlcode/posix/ttyname.plrezultat będzie zależny od podanego argumentu wywołania programu:
/home/local/code/perlcode/posix/ttyname.pl: ttyinfo=ttyname(STDIN_FILENO=0): ttyinfo=/dev/pts/44 /home/local/code/perlcode/posix/ttyname.pl: ttyinfo=ttyname(STDOUT_FILENO=1): ttyinfo=/dev/pts/44 /home/local/code/perlcode/posix/ttyname.pl: ttyinfo=ttyname(STDERR_FILENO=2): ttyinfo=/dev/pts/44 /home/local/code/perlcode/posix/ttyname.pl: if (open(GLOB(0x94d5dd8),/home/local/code/perlcode/posix/ttyname.pl)); Successful opened file '/home/local/code/perlcode/posix/ttyname.pl'. /home/local/code/perlcode/posix/ttyname.pl: ttyinfo=ttyname(3): else: ttyinfo=UNDEFINED
#top uname¶
Documentacja online: perldoc.perl.org | www.tutorialspoint.com
Deklaracja funkcji
uname()
jest następująca:uname
Powiązane:
Opis:
description
Example:
zawartość pliku
uname.pl
SELECT ALL
#!/usr/bin/perl -w use strict; # force definations for all vars an subroutines use warnings; # force check of unset variables in expressions use diagnostics; # give var/code line number on faults use POSIX; my ($sysname, $nodename, $release, $version, $machine); if ($#ARGV+1<0) { print("Usage: $0 </path/to/filename>\n"); exit(1); } ($sysname, $nodename, $release, $version, $machine)=uname(); print""$0: (\$sysname, \$nodename, \$release, \$version, \$machine)=uname(): \$sysname=$sysname \$nodename=$nodename \$release=$release \$version=$version \$machine=$machine\n");
Aby zobaczyć jak działa program należy go uruchomić bez argumentów:
/home/local/code/perlcode/posix/uname.plprogram wyświetli stosowne informacje o sposobie działania:
/home/local/code/perlcode/posix/uname.pl: ($sysname, $nodename, $release, $version, $machine)=uname(): $sysname=Linux $nodename=xnd.nat.wbcd.pl $release=2.6.18-128.el5 $version=#1 SMP Wed Jan 21 10:44:23 EST 2009 $machine=i686
Zmodyfikowany ostatnio: 2013/11/20 22:42:16 (11 lat temu),
textsize: 28,4 kB,
htmlsize: 54,3 kB
Zapraszam do komentowania, zgłaszania sugestii, propozycji, własnych przykładów, ...
Dodaj komentarzKomentarze użytkowników