Using Perl instead of awk or sed

Unix — Dillon @ 11:29 am

You want to use Perl to process things on the command line but you don’t want to write/save a file. You want to replace sed with something more clunky. :)


[user@server tmp]$ ls / | perl -e 'while (){ print $_; }'
bin
boot
dev
etc
home
initrd
lib
lost+found
misc
mnt
opt
proc
root
sbin
tmp
usr
var
[user@server tmp]$ ls / | perl -e 'while (){ print "/" . $_; }'
/bin
/boot
/dev
/etc
/home
/initrd
/lib
/lost+found
/misc
/mnt
/opt
/proc
/root
/sbin
/tmp
/usr
/var

0 Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2012 SQUARISM | powered by WordPress with Barecity