- Linux
- OpenBSD
- FreeBSD
- Solaris
- bash/shell
- » ab
- » arp
- » arping
- » awk
- » bzip2, bunzip2, bzip2re...
- » chcase
- » chkconfig
- » chmod
- » chown
- » comm
- » convert
- » cat
- » cp
- » cpio
- » cryptsetup
- » curl
- » date
- » diff
- » dig
- » dumpe2fs
- » e2fsck(fsck.{ext2,ext3})
- » eval
- » exportfs
- » file
- » find
- » ftp
- » fuser
- » getfacl
- » grep, egrep, fgrep
- » grub
- » gzip, gunzip
- » hdparm
- » head
- » host
- » ifconfig
- » ifenslave
- » import
- » ionice
- » ip
- » ipcs, ipcrm
- » kill
- » ldconfig
- » ld
- » ldd
- » less
- » locale
- » locate
- » losetup
- » ls
- » lsmod
- » lsof
- » man
- » mke2fs(mkfs.{ext2,ext3})
- » mkinitrd
- » mknod
- » mkswap
- » modinfo
- » modprobe
- » mount
- » mtr
- » mv
- » mysql
- » mysqladmin
- » mysqldump
- » netstat
- » netstat-nat
- » nice
- » nc
- » nm
- » nslookup
- » objdump
- » openssl
- » parted
- » patch
- » perl
- » pg_dump
- » pidof
- » ping
- » pkg-config
- » ps
- » psql
- » rar
- » readelf
- » renice
- » rm
- » rmmod
- » route
- » rpcinfo
- » rpm
- » rsync
- » screen
- » sed
- » sendmail
- » seq
- » setfacl
- » sfdisk
- » showmount
- » shred
- » smartctl
- » smbclient
- » smbget
- » smbpasswd
- » socat
- » sort
- » sox
- » split
- » ssh
- » ssh-keygen
- » stat
- » stdbuf
- » strace
- » svn, svnadmin
- » systool
- » tail
- » tar
- » tcpdump
- » top
- » tr
- » tracepath
- » traceroute
- » tune2fs
- » udevcontrol, udevadm
- » unclutter
- » uniq
- » unzip
- » uuencode, uudecode
- » vim
- » vncviewer
- » vnstat
- » wc
- » wget
- » wput
- » xargs
- » xhost
- » xprop
- » xrandr
- » xwd
- » xxd
- » yum
- » zip, zip{cloak,note,split}
- KDE
- GTK
CONTENT
- CHANGES
Szukaj
#top perl¶
perl - Practical Extraction and Report Language
Powiązane:
awk, perl
SYNOPSIS
perl [ -sTtuUWX ] [ -hv ] [ -V[:configvar] ] [ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ] [ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ] [ -Idir ] [ -m[-]module ] [ -M[-]’module...’ ] [ -f ] [ -C [number/list] ] [ -P ] [ -S ] [ -x[dir] ] [ -i[extension] ] [ -e ’command’ ] [ -- ] [ programfile ] [ argument ]...
DESCRIPTION
OPTIONS
-0[octal]
-a
-C[number/list]
-c
-d[:debugger]
-D[number/list]
-e program
-f
-F/pattern/
-i[extension]
-Idirectory
-l[octal]
-[mM][-]module
-n
-p
-P
-s
-S
-t
-T
-u
-U
-v
-V[:variable]
-w
-W
-x[directory]
-X
specify record separator (\0, if no argument)
-a
autosplit mode with -n or -p (splits $_ into @F)
-C[number/list]
enables the listed Unicode features
-c
check syntax only (runs BEGIN and CHECK blocks)
-d[:debugger]
run program under debugger
-D[number/list]
set debugging flags (argument is a bit mask or alphabets)
-e program
one line of program (several -e's allowed, omit programfile)
-f
don't do $sitelib/sitecustomize.pl at startup
-F/pattern/
split() pattern for -a switch (//'s are optional)
-i[extension]
edit <> files in place (makes backup if extension supplied)
-Idirectory
specify @INC/#include directory (several -I's allowed)
-l[octal]
enable line ending processing, specifies line terminator
-[mM][-]module
execute "use/no module..." before executing program
-n
assume "while (<>) { ... }" loop around program
-p
assume loop like -n but print line also, like sed
-P
run program through C preprocessor before compilation
-s
enable rudimentary parsing for switches after programfile
-S
look for programfile using PATH environment variable
-t
enable tainting warnings
-T
enable tainting checks
-u
dump core after parsing program
-U
allow unsafe operations
-v
print version, subversion (includes VERY IMPORTANT perl info)
-V[:variable]
print configuration summary (or a single Config.pm variable)
-w
enable many useful warnings (RECOMMENDED)
-W
enable all warnings
-x[directory]
strip off text before #!perl line and perhaps cd to directory
-X
disable all warnings
EXAMPLES
perl -MMIME::Base64 -e ' print(encode_base64("test")."\n"); '
/usr/bin/perl /usr/share/logwatch/scripts/shared/applystddate
Can't locate Logwatch.pm in @INC (@INC contains: /usr/share/logwatch /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/share/logwatch/scripts/shared/applystddate line 13.
/usr/bin/perl -I/usr/share/logwatch/lib /usr/share/logwatch/scripts/shared/applystddate
message with polish locale
LANG=pl_PL.UTF-8
perl -e 'use POSIX qw(strftime); print(strftime("%a, %d %b %Y %H:%M:%S +0200",localtime(time()))."\n")'
śro, 22 maj 2013 00:00:00 +0200
message with english locale
perl -e 'use POSIX qw(strftime); use POSIX qw(locale_h); setlocale(LC_TIME, "en_US.UTF-8"); print(strftime("%a, %d %b %Y %H:%M:%S +0200",localtime(time()))."\n")'
Wed, 22 May 2013 00:00:00 +0200
HTTP HEADER:
Date:
perl -e 'use POSIX qw(strftime); use POSIX qw(locale_h); setlocale(LC_TIME, "en_US.UTF-8"); print(strftime("%a, %d %b %Y %H:%M:%S GMT",localtime(time()-3600))."\n")'
Date: Mon, 09 Dec 2013 17:36:10 GMT
reading file like tail: while(1) { while($line=<FH>) { ... } }
perl -e ' if(open($fpr,"/home/user/tmp/ola")) { while (1) { while ($line=<$fpr>) { $line=~s,[\r\n]*$,,g; print("line=|$line|\n"); } seek($fpr, 0, 1); } close($fpr); } else { print("Unable open file: ola, Reason $!\n"); } '
Zmodyfikowany ostatnio: 2014/07/16 12:22:21 (10 lat temu),
textsize: 5,88 kB,
htmlsize: 7,20 kB
Zapraszam do komentowania, zgłaszania sugestii, propozycji, własnych przykładów, ...
Dodaj komentarzKomentarze użytkowników