Use Perl inside Shell scripts
Perl is a far more powerful programming tool than any shell script. Sometimes you want to borrow some of that power without having to rewrite your entire shell script. There is an easy way to integrate Perl snippets inside your shell script.
In the following example we encapsulate a Perl script inside of a Korn shell function. The Perl script outputs the value of Perl $email variable. We then assign the value of this Perl variable to a shell variable by executing the function:
#!/bin/ksh perl_email() { /usr/bin/perl << 'EOF' use EmailClient; my $obj = EmailClient-new; my $email = $obj-getData( -field = 'email' ); print "$email"; EOF } SHELL_EMAIL=$(perl_email)
you very nice article I was interested to read it
I’m looking for the files containing a certain text string and when I find them, I want to move them into another directory. I’ve tried grepping and then piping to a mv command, but this does not work. Again, I am using ksh.
Thanks in advance