3 #+EMAIL: seudut@gmail.com
6 * Programming Languages
10 #+BEGIN_SRC gnuplot :exports code :file ./temp/sin.png
16 [[file:./temp/sin.png]]
18 2. plot with data file
24 * Perl One Line Command
25 #+BEGIN_SRC sh :exports both :results output replace
32 Usage: perl [switches] [--] [programfile] [arguments]
33 -0[octal] specify record separator (\0, if no argument)
34 -a autosplit mode with -n or -p (splits $_ into @F)
35 -C[number/list] enables the listed Unicode features
36 -c check syntax only (runs BEGIN and CHECK blocks)
37 -d[:debugger] run program under debugger
38 -D[number/list] set debugging flags (argument is a bit mask or alphabets)
39 -e program one line of program (several -e's allowed, omit programfile)
40 -E program like -e, but enables all optional features
41 -f don't do $sitelib/sitecustomize.pl at startup
42 -F/pattern/ split() pattern for -a switch (//'s are optional)
43 -i[extension] edit <> files in place (makes backup if extension supplied)
44 -Idirectory specify @INC/#include directory (several -I's allowed)
45 -l[octal] enable line ending processing, specifies line terminator
46 -[mM][-]module execute "use/no module..." before executing program
47 -n assume "while (<>) { ... }" loop around program
48 -p assume loop like -n but print line also, like sed
49 -s enable rudimentary parsing for switches after programfile
50 -S look for programfile using PATH environment variable
51 -t enable tainting warnings
52 -T enable tainting checks
53 -u dump core after parsing program
54 -U allow unsafe operations
55 -v print version, patchlevel and license
56 -V[:variable] print configuration summary (or a single Config.pm variable)
57 -w enable many useful warnings
58 -W enable all warnings
59 -x[directory] ignore text before #!perl line (optionally cd to directory)
60 -X disable all warnings
62 Run 'perldoc perl' for more help with Perl.
68 perl -ne 'print if /expression/' xxx.log;
73 perl -wnl -e '/keyword/ and print;' xxx.log
79 perl -ne 'print "$1\n" if /aaa=(\d+)\s.*/' xxx.log;
84 perl -pe 'some code' < input.txt > output.txt