SLWRMemo
perl -wnl -e 'print;' file file2
- SED-like replace function:
- "-n" --> feed each line into $_
perl -wnl -e 's/^/ /g; print;' file
- "-p" --> feed & print each line #beautifully simple!
perl -wpl -e 's/^/ /g;' file
perl -00 -wnl -e 'print "$.:$_";' file | fmt -60
perl -M'Text::Autoformat' -00 -wn -e 'print autoformat "$.: $_", {right => 60};' file
perl -wnl -e 'print;' file
- これと同じものを vi で作って chmod で実行権限を与える
vi perl_cat
chmod +x perl_cat
ls -l perl_cat
-rwxr-xr-x 1 tono tono 30 5 6 19:48 perl_cat
./perl_cat file