博客主页:http://blog.csdn.net/minna_d
1. a2p 将awk 脚本转化为perl 脚本命令
转化后的结果并不一定可靠,需要人工干预.
[root@jjy ~/q/data/hongkongAndMacaoPoint/poi]# cat awkTest.sh
#!/bin/bash
echo $1
awk '{for(i=0; i < NF; i++){ print $i}}' $1
[root@jjy ~/q/data/hongkongAndMacaoPoint/poi]# a2p -o awkTest.sh perlTest.pl
Unrecognized character ' in file awkTest.sh line 3--ignoring.
Unrecognized character ' in file awkTest.sh line 3--ignoring.
#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
# this emulates #! processing on NIH machines.
# (remove #! line above if indigestible)
eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;
# process any FOO=bar switches
#!/bin/bash
$, = ' '; # set output field separator
$\ = "\n"; # set output record separator
while (<>) {
chomp; # strip record separator
@Fld = split(' ', $_, -1);
print $_ if $echo . $Fld[(1)-1];
if ($awk) {
for ($i = 0; $i < ($#Fld+1); $i++) {
print $Fld[$i];
}
}
print $_ if $Fld[(1)-1];
}
2. a2ping 图片、文档格式转化命令
[root@jjy ~/q/data/tmp_data]# a2ping --bboxfrom=compute-gs /notSolidHd/learing_document/shell12.pdf xx.eps
接受输入格式: PS (PostScript), EPS, PDF, PNG, JPEG, TIFF, PNM, BMP, GIF, L