#模拟交互
[root@iZ23n5z6svlZ ~]# perl -e 'print "==>";while(<STDIN>){eval($_);print "\n==>";}'
==>$a="lala";
==>print $a."\n";
lala
==>
#one line program
perl -lne 'print $1 if (/(\b\S+map\S+\b)/)' tm |grep srw | sort -u
cat jjkk | grep -E 'Hostname:|Function:'| perl -nle 'print $1.$2 if(/(Hostname:|ID:|Function:|Description:|Test URI:|Ping Test:|Nukit:|ValidateInternals:|Special:|Rank:|Bladecenter:).*>([^<>]+)(<\/\w+>)+$/) '| sed 's/ //'
cat jjkk | grep -E 'Hostname:|ID:|Function:|Description:|Test URI:|Ping Test:|Nukit:|ValidateInternals:|Special:|Rank:|Bladecenter:'| perl -nle 'print $1.$2 if(/(Hostname:|ID:|Function:|Description:|Test URI:|Ping Test:|Nukit:|ValidateInternals:|Special:|Rank:|Bladecenter:).*>([^<>]+)(<\/\w+>)+$/) '
perl -nle 's/(^\s+|\s+$)//g;print $_ unless (/^$/)' jk
perl -nle 's/(^\s+|\s+$)//g;' -e 'print $_ unless (/^$/)' jk
perl -i.bak -p -e 'BEGIN{$flag=2} if (/^~~~/ and $flag == 2) {s/^~~~/startflag/ ; $flag=3 } ; if (/^~~~/ and $flag == 3) {s/^~~~/endflag/ ; $flag=2 }' jk.md
cat u |cut -c 2-11 > time_s
paste <(for i in `cat time_s`; do date -d "1970-01-01 UTC $i seconds" +"%x %X%z %Z" ; done) <(cat u)
exec 8>u.log1
exec 9>u.log2
ll /proc/self/fd
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。