導航:首頁 > 程序命令 > aixperl命令

aixperl命令

發布時間:2022-05-25 02:05:05

① 如何利用perl命令行, 來執行正則表達式,尋找匹配的行

樓上的是找出其中之一呀,樓主要的是同時包含兩個句子。
可以這樣
perl -n -e 'print if ($_ =~/Barney/ && $_ =~ /Fred/)' test.txt >new.txt

其實這樣的實現用awk命令這些很好用。樓主可以學習學習awk sed grep 等命令。
我補充個實例吧。
awk '{if (/Barney/ && /Fred/) print }' test.txt > new.txt
more test.txt | grep Barney | grep Fred >new.txt (這個管道用著很有意思)
都測試了一下,可行

② perl: 如下命令

用雙引號:
perl -p -i.bak -w -e "s/a/b/g" fred.pl
---------------------------
C:\Documents and Settings\t>perl -p -e "" fred.pl
abc

C:\Documents and Settings\t>perl -p -i.bak -w -e 's/a/b/g' fred.pl
Useless use of a constant in void context at -e line 1.

C:\Documents and Settings\t>del fred.pl.bak

C:\Documents and Settings\t>perl -p -i.bak -w -e "s/a/b/g" fred.pl

C:\Documents and Settings\t>perl -p -e "" fred.pl
bbc

③ 在AIX中,哪個命令可以看到哪些進程在用哪個埠

abi-0.7.13.0 6528848 bytes March 2 2001
aix.tools-1.5.4.0 423305 bytes March 2 2001
analog-4.13.0.1 614795 bytes November 9 2000
apache-1.3.19.0 1390979 bytes March 28 2001
apache-1.3.20.0 1570217 bytes August 31 2001
apache-1.3.24.0 1556657 bytes June 12 2002
apache-2.0.36.0 4300967 bytes September 2 2002
apache-2.0.40.0 4437716 bytes September 24 2002
apache.auth_ldap-1.5.2.0 108085 bytes February 6 2001
apache.jserv-1.1.2.0 780496 bytes November 17 2000
apache.mod_perl-1.25.0.0 741278 bytes February 16 2001
apache.mod_ssl-2.8.0.0 618620 bytes February 2 2001
apache.mod_ssl-2.8.2.0 827170 bytes April 25 2001
bind-8.2.3.0 1113584 bytes February 2 2001
bind-8.2.4.0 5422740 bytes August 31 2001
bind-9.1.0.0 4533200 bytes February 2 2001
bind-9.1.3.0 26996662 bytes August 31 2001
bind-9.2.0.0 7694477 bytes January 18 2002
bind-9.2.1.0 23289255 bytes September 18 2002
bindssl-9.2.0.0 11005244 bytes January 18 2002
bison-1.35.0.0 528228 bytes June 5 2002
bull.mklpp-1.2.9.0 194564 bytes February 16 2001
bzip2-1.0.1.0 175316 bytes November 20 2000
cdrecord-1.9.0.0 887640 bytes February 16 2001
cdrtools-1.10.0.0 1178074 bytes September 20 2002
cgilib-0.5.0.1 82108 bytes July 6 2000
courier-imap-1.5.3.0 1977540 bytes November 28 2002
cscope-1.5.0.0 147632 bytes March 16 2001
cvs-1.11.0.0 869064 bytes November 10 2000
db-2.7.7.0 1828435 bytes October 20 1999
db3-3.1.17.0 1509569 bytes January 15 2001
db3-3.2.9.0 1737723 bytes February 9 2001
delegate-5.9.1.0 886815 bytes March 19 1999
dmalloc-4.7.1.0 398263 bytes August 24 2000
dvi-4.0.0.0 306280 bytes November 19 1999
dxpc-3.8.1.0 555623 bytes October 7 2002
egd-0.8.0.0 91208 bytes March 19 2001
ethereal-0.8.11.0 1988029 bytes November 21 2000
expect-5.31.5.0 644331 bytes March 17 2000
fetchmail-5.0.0.1 322566 bytes October 6 1999
fetchmail-5.8.14.0 602984 bytes September 12 2001
fltk-1.0.10.0 1358891 bytes January 8 2001
freetype-1.3.1.0 1083376 bytes February 28 2000
freetype-2.0.1.0 526283 bytes March 2 2001
gcc-3.0.1.0 40588088 bytes September 14 2001
gd-1.8.4.0 284095 bytes March 2 2001
gimp-1.2.1.0 9112021 bytes March 3 2001
gimp.perl-1.2.1.0 741093 bytes March 20 2001
gkermit-1.0.0.0 141938 bytes November 27 2000
glib-1.2.8.0 281036 bytes January 2 2001
gnu.autoconf-2.13.0.0 361770 bytes February 16 2000
gnu.automake-1.4.0.0 310684 bytes August 24 2000
gnu.bash-2.4.0.0 805402 bytes November 20 2000
gnu.bison-1.25.0.0 220315 bytes June 18 1999
gnu.cpio-2.4.2.0 134132 bytes December 11 2000
gnu.diff-2.7.0.0 218560 bytes November 20 2000
gnu.flex-2.5.4.0 418723 bytes April 15 1999
gnu.gawk-3.0.5.0 582820 bytes June 30 2000
gnu.gcc-2.95.3.0 5126660 bytes March 28 2001
gnu.gcc.g++-2.95.3.0 7718470 bytes March 28 2001
gnu.gcc.info-2.95.3.0 818948 bytes March 28 2001
gnu.gdb-5.0.0.0 2536075 bytes May 23 2000
gnu.gdbm-1.8.0.0 125841 bytes August 24 2000
gnu.gettext-0.10.35.0 464789 bytes December 30 1999
gnu.ghostscript-5.10.0.0 3077454 bytes April 20 1999
gnu.ghostview-3.5.8.0 542093 bytes April 3 2000
gnu.grep-2.3.0.0 288211 bytes October 12 1999
gnu.groff-1.11.1.0 5313139 bytes June 2 1999
gnu.gzip-1.2.4.1 173338 bytes June 30 2000
gnu.indent-1.10.0.0 132501 bytes July 13 1999
gnu.make-3.79.1.0 500644 bytes June 30 2000
gnu.patch-2.5.4.0 166131 bytes January 19 2001
gnu.pg-1.0.4.0 1114942 bytes January 8 2001
gnu.plotutils-2.3.0.0 2423041 bytes February 16 2001
gnu.rcs-5.7.0.0 498152 bytes November 20 2000
gnu.readline-4.1.0.1 397500 bytes December 4 2000
gnu.screen-3.9.8.0 460625 bytes December 4 2000
gnu.tar-1.13.0.0 454894 bytes November 20 2000
gnu.wget-1.6.0.0 350449 bytes January 19 2001
gnujsp-1.0.1.0 510940 bytes December 4 2000
gnupg-1.0.6.0 1892556 bytes August 9 2001
gnupg-1.0.7 1992206 bytes December 11 2002
gnupg-1.2.1 2133622 bytes December 11 2002
gnuplot-3.7.1.0 623968 bytes March 16 2001
gtk+-1.2.8.0 2070401 bytes March 5 2001
hdf5-1.2.1.0 1184727 bytes March 24 2000
httptunnel-3.0.5.0 369002 bytes June 10 2002
ijb-2.0.2.0 173591 bytes May 12 2000
imageMagick-5.2.4.0 2971988 bytes November 20 2000
iozone-3.23.0.0 490764 bytes May 12 2000
itools-6.3.0.0 217179 bytes November 19 1999
jbigkit-1.0.0.0 376285 bytes March 24 2000
jpeg-6.0.2.0 361765 bytes December 23 1999
libIDL-0.6.8.0 168187 bytes December 18 2000
libmng-1.0.0.0 314199 bytes March 2 2001
libpcap-0.6.1.0 147290 bytes January 15 2001
libpng-1.0.9.0 498112 bytes March 2 2001
libungif-4.1.0.1 384216 bytes July 6 2000
libwmf-0.1.21.0 613229 bytes December 30 2000
libxml-1.8.7.0 329778 bytes March 10 2000
lsof-4.55.0.0 386162 bytes February 16 2001
mgetty-1.1.20.0 1096745 bytes June 15 1999
mm-1.1.3.0 107810 bytes February 2 2001
monitor-2.1.9.0 255706 bytes March 28 2001
mpack-1.5.0.0 113310 bytes March 19 1999
mpeg_lib-1.2.0.0 201351 bytes March 23 1999
mrtg-2.9.17.0 859926 bytes March 14 2002
mtools-3.9.5.0 311884 bytes June 25 1999
mutt-0.95.6.0 821995 bytes July 13 1999
mysql++-1.7.8.0 635569 bytes January 8 2001
mysql++-1.7.9.0 7879735 bytes August 31 2001
mysql-3.23.35.0 4498964 bytes March 26 2001
mysql.client-3.23.35.0 693359 bytes March 26 2001
neat-4.2.0.0 94713 bytes March 20 2001
netpbm-9.4.0.0 945343 bytes June 23 2000
netsaint-0.0.6.0 1547206 bytes December 18 2000
netsaint.plugins-1.2.8.4 431459 bytes February 9 2001
net-snmp-5.0.3.0 16194678 bytes October 8 2002
nmap-2.53.0.0 444670 bytes November 21 2000
ntop-1.3.2.0 942025 bytes November 9 2000
openssh-2.5.1.0 618398 bytes February 23 2001
openssh-2.9.2.0 656667 bytes September 14 2001
openssh-3.0.2.1 2220719 bytes January 16 2002
openssh-3.4.0.0 2584381 bytes August 26 2002
openssh-3.5.0.0 3010839 bytes November 27 2002
openssh-oldlibc-3.0.2.1 2221671 bytes January 23 2002
openssl-0.9.6.0 1620889 bytes October 23 2000
openssl-0.9.6.2 2497957 bytes September 14 2001
openssl-0.9.6.3 1988448 bytes January 17 2002
openssl-0.9.6.7 2004564 bytes September 2 2002
perl-5.6.0.1 6566331 bytes March 16 2001
perl-5.6.1.0 9618174 bytes May 3 2001
perl.DBI-1.14.0.0 340737 bytes March 20 2001
perl.dbd.mysql-1.22.15.0 235056 bytes March 20 2001
perl.dbd.oracle-1.6.0.0 221421 bytes March 20 2001
perl.gtk-0.70.5.0 803078 bytes March 20 2001
perl.html.embperl-1.3.0.0 439370 bytes December 6 2000
perl.html.embperl-1.3.1.0 459235 bytes March 20 2001
perl.html.parser-3.13.0.0 161093 bytes March 20 2001
perl.html.tagset-3.3.0.0 70796 bytes March 20 2001
perl.libnet-1.7.3.0 156919 bytes March 20 2001
perl.libwww-5.41.0.0 268968 bytes March 20 2001
perl.md5-2.12.0.0 144849 bytes March 20 2001
perl.mime.base64-2.11.0.0 85146 bytes March 20 2001
perl.net.pcap-0.3.0.0 87538 bytes December 6 1999
perl.net.pcap-0.4.0.0 94873 bytes March 20 2001
perl.net.ssleay-1.5.0.0 135331 bytes March 20 2001
perl.net.telnet-3.2.0.0 110343 bytes March 20 2001
perl.netpacket-0.1.0.0 71547 bytes December 6 1999
perl.pdl-2.2.0.0 1738287 bytes March 20 2001
perl.readline-1.9.0.0 13 bytes March 20 2001
perl.tk-8.0.15.0 2331363 bytes March 20 2001
perl.uri-1.9.0.0 163887 bytes March 20 2001
php4-4.0.4.1 1636451 bytes February 9 2001
php4-4.0.6.0 1825522 bytes August 31 2001
pine-4.32.0.0 5210964 bytes January 19 2001
postfix-1.1.9903.0 3581687 bytes March 19 1999
postfix-1.2.102.0 5079147 bytes August 31 2001
postfix-1.1.11.0 6323864 bytes September 4 2002
postgresql-7.0.2.0 5673326 bytes October 12 2000
postgresql-7.1.2.0 5562626 bytes August 31 2001
postie-1.1.9903.0 514717 bytes March 23 1999
procmail-3.13.1.0 211811 bytes March 16 2001
procmail-3.21.0.0 259498 bytes August 8 2001
proftpd-1.2.0.0 444854 bytes November 20 2000
proftpd-1.2.1.0 442862 bytes August 8 2001
pty-3.1.0.0 146379 bytes June 2 1999
python-2.0.0.0 4125125 bytes November 27 2000
python-2.1.1.0 6609111 bytes August 31 2001
ralcgm-3.50.0.0 1028473 bytes March 24 2000
rdist-6.1.5.0 230798 bytes September 20 2001
rpm-4.0.0.0 1220417 bytes March 5 2001
rrdtool-1.0.33.0 590662 bytes March 2 2001
rsync-2.3.1.0 203021 bytes May 19 1999
rtspd-1.0.0.0 169391 bytes October 26 2000
samba-2.0.7.0 5017365 bytes April 26 2000
samba-2.2.0.0 8854707 bytes April 25 2001
samba-2.2.1.1 10154005 bytes August 8 2001
samba-2.2.3a 10846627 bytes May 3 2002
samba-2.2.5.0 10505178 bytes September 30 2002
samba-2.2.7.0 11510552 bytes February 28 2003
satan-1.1.1.1 413385 bytes October 8 2002
satan-2.0.1.0 1402620 bytes October 8 2002
scotty-0.2.21.0 1710509 bytes May 12 2000
sendmail-8.11.3.0 1902962 bytes March 2 2001
sendmail-8.11.6.0 1349963 bytes August 31 2001
sharity-2.3.0.0 1153388 bytes November 21 2000
sms_client-2.0.8.0 224990 bytes January 19 2001
sms_client-2.0.8.25 198825 bytes September 20 2001
sqmgrlog-2.12.0.0 152503 bytes January 8 2001
squid-2.3.4.0 679688 bytes August 24 2000
squid-2.4.1.0 837909 bytes August 31 2001
sudo-1.6.3.6 266413 bytes February 23 2001
stunnel-3.22.0.0 622418 bytes May 28 2002
sudo-1.6.6.0 228815 bytes May 3 2002
t1lib-0.9.1.0 1132728 bytes August 25 1999
tcl-8.1.1.0 1626947 bytes June 23 1999
tcl-8.2.3.0 1697793 bytes December 18 2000
tcp_wrappers-7.6.1.0 162727 bytes December 18 2000
tcpmp-3.5.2.0 258073 bytes December 18 2000
tcpmp-3.6.1.0 294783 bytes January 15 2001
termpkg-3.0.0.0 177853 bytes June 2 1999
tidy-1.0.9904.0 221609 bytes April 12 1999
tidysys-2.2.1.0 68974 bytes March 13 2002
tiff-3.5.4.0 820755 bytes December 18 2000
tk-8.1.1.0 1516634 bytes June 23 1999
tk-8.2.3.0 1515682 bytes December 18 2000
tofrodos-1.4.0.0 86101 bytes December 18 2000
top-3.4.0.0 145928 bytes September 20 2001
transfig-3.2.3.0 415422 bytes December 18 2000
unzip-5.41.0.0 276860 bytes April 26 2000
urt-3.1.2.0 558576 bytes June 23 2000
viewfax-2.4.0.0 127596 bytes May 4 2000
vim-5.7.0.0 2007105 bytes September 21 2000
vim-6.0.0.0 2821376 bytes January 17 2002
vnc-3.3.3.2 1284554 bytes February 16 2001
webalizer-1.31.6.0 204872 bytes February 28 2000
webalizer-2.1.6.0 234220 bytes March 5 2001
webmin-0.81.0.0 2357141 bytes March 20 2001
webmin-0.88.0.0 3918623 bytes September 27 2001
wu-ftpd-2.6.1.0 320768 bytes July 27 2000
wv-0.6.2.0 1589598 bytes December 30 2000
xaw3d-1.3.0.0 295319 bytes April 3 2000
xdir-2.1.2.1 358648 bytes March 19 1999
xemacs-21.1.2.0 6215454 bytes June 15 1999
xfig-3.2.3.0 1816554 bytes January 5 2000
xftp-2.1.0.1 251799 bytes March 19 1999
xkeycaps-2.46.0.0 553520 bytes February 16 2001
xmx-2.1.9906.0 606686 bytes June 18 1999
xpaint-2.6.1.0 604293 bytes November 20 2000
xpbiff-1.27.0.0 211890 bytes April 3 2000
xpdf-0.9.0.0 1177607 bytes August 25 1999
xpm-3.4.11.0 203985 bytes December 30 1999
xps-3.14.0.0 172053 bytes July 13 1999
xv-3.10.1.0 1554327 bytes March 14 1997
zebedee-2.1.3.0 203860 bytes December 11 2000
zip-2.3.0.0 241718 bytes April 26 2000
zlib-1.1.3.2 137929 bytes March 5 2001
zlib-1.1.4.0 218369 bytes May 16 2002

④ aix 腳本 建資料庫,表

在AIX下可用perl腳本可以連接資料庫並進行操作,具體看你是什麼資料庫,到時連接時申明一下

⑤ AIX下如何去除shell腳本中的^M符號

1、dos格式文件傳輸到unix系統時,會在每行的結尾多一個^M,可以將dos文件轉換為unix文件格式。也有可能看不到
2、vi轉換
用命令:set ff?可以看到dos或unix的字樣.vi dos.txt
:set fileformat=unix
:w
3、也可以用sed 這樣的工具來做:
sed 『s/^M//』 filename > tmp_filename
其中^M是同時Ctrl+V+M按出來的,表示回車。
4、或用vi替換
vi dos_file.txt
:%s/^M//g
5、使用tr
命令:tr -d 「\015」 dos_file.txt
6、使用perl
cat dos_file.txt | perl -pe 『~s/\r//g』 > unix_file.txt

⑥ 請教:aix下如何安裝perl環境

開源的gcc自然可以算是最佳選擇。在64位平台的AIX中,如果選擇運用 gcc來編譯perl源代碼,默認情況下是編譯成32位的版本。這樣在編譯DBD::Oracle的時候也須要選擇正確的32位庫,否則不能編譯成功。

⑦ 請問,在AIX中svmon -Pt30 | perl -e 'while(<>){print if($.==2||$&&&!$s++);$.=0 if(/^-+$/)}'這段命令

AIX什麼的我不太懂~
不過後面的perl 命令我可以解釋下

首先需要知道perl 中 $. 的用法,上次閱讀的文件的當前輸入行號,可以簡單的理解為文件的行號,從1開始。
$.=0 if(/^-+$/); 這里的意思就是如果發現本行是以 - 組成的,那麼把當前行號至為0 ,那麼下一行就為1;
print if($.==2||$&&&!$s++); 當這個行號為2的時候($.==2)或者第一次匹配到-------之後的下一行($& && !$s++),列印出本行

例如,通道內容如下:
虛擬行號 實際行號 內容

1 1 test line 1
2 2 test line 2 #列印,虛擬行號為2

3 3 test line 3
4 4 ------------------------------------
1 5 fisrt line after -------- #列印,為第一個------後的下一行

2 6 second line 2 #列印,虛擬行號為2

3 7 second line 3
4 8 -
1 9 --
1 10 ---
1 11 third line 1

2 12 ---- #列印,虛擬行號為2

1 13 4th line 1
2 14 4th line 2 #列印,虛擬行號為2

感覺是個很詭異的邏輯,不知道實際上有什麼用~

⑧ 如何使用perl命令行對文件中插入1行文字

在某文件末尾插入一行文字perl -e 'print "hello"' >> world.txt

⑨ 如何用perl運行單行命令

可以使用單撇號,例如:

$str=`ls-f`;

這個語句執行命令ls -f並把結果存放到字元串變數$str裡面。

⑩ 如何查看AIX系統上次密碼修改時間

在系統文件/etc/security/passwd中記錄有每個用戶登陸密碼的加密形式,以及上次修改密碼的時間,我們以root為例:
root:
password = hVvR/QGnSNKlE
flags =
lastupdate = 1200982154
此處,lastupdate為上次密碼修改時間,以epoch time表示。Epoch time是從Epoch(新紀元時間,傳說中的標志Unix時代開端的那個拂曉)開始計算起,單位為秒,Epoch則是指定為1970年一月一日凌晨零點零分零秒,格林威治時間。我們可以通過下面的命令來轉換epoch time:
#perl -le 'print scalar localtime 1200982154'
Tue Jan 22 06:09:14 2008
所以,root用戶上次修改密碼是在2008年1月22日上午06:09:14。

閱讀全文

與aixperl命令相關的資料

熱點內容
租雲伺服器開發 瀏覽:804
程序員告白媽媽不同意 瀏覽:327
攻城掠地怎麼查看伺服器 瀏覽:592
android開機黑屏 瀏覽:568
mc純生存伺服器是什麼意思 瀏覽:440
樹莓派火焰蜂鳴器python 瀏覽:898
我的世界伺服器強制疾跑怎麼開 瀏覽:277
用什麼app看施工圖紙 瀏覽:493
張三學python函數 瀏覽:379
女子程序員照片 瀏覽:307
武漢c程序員招聘 瀏覽:683
csk跟蹤演算法 瀏覽:26
數據挖掘中用到的演算法 瀏覽:845
更改ubuntu伺服器地址 瀏覽:504
學做燒菜用什麼app 瀏覽:704
程序框圖怎麼加密 瀏覽:374
文件自解壓失敗怎麼辦 瀏覽:901
ug操作和產品命令 瀏覽:81
QQ在線表格怎麼加密 瀏覽:486
steam星際戰甲什麼伺服器 瀏覽:598