Linux LVM: Reduce Filesystem and Logical Volume
March 14, 2012 – 5:07 pm | No Comment

The following example shows how to reduce the size of a filesystem mounted on an LVM logical volume. The instructions below are only for non-root filesystems. No reboot is required, but the filesystem will need to be unmounted. So, if there are any user applications using this filesystem, they will need to be stopped and the users will need to log out.

Read the full story »
Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Commands & Shells

Use Perl inside Shell scripts

Submitted by on May 1, 2008 – 11:44 amOne Comment
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)

Popularity: 3% [?]

Related posts:

  1. Generating complex SQL queries with shell scripts
  2. Database operations with SQL and Korn shell
  3. Wget examples and scripts
  4. Passing shell variables to awk and sed
  5. Korn Shell Arrays

One Comment »

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.