Script to list applications in alphabetical order

view story

http://www.unix.com – I've looking over a script for work and I've had a problem with the script not listing the files in alphabetical order. To look up PIDs for apps, it would be beneficial to have them listed in that order. Here is what I've been reviewing. #!/usr/bin/perl $str = sprintf "%4s %-40s", "PID", "SERVER NAME"; print "$str\n"; { @tomcat_ps = `/usr/ucb/ps auxwwe |grep -v grep| grep -i CATALINA_BASE`; foreach $line (@tomcat_ps) { $_ = $line; /.*weblogic (.*[0-9]) \ [0-9].[0-9] .*Dcatalina.base=(\/.*) .*Dcatalina.home*/; print " (HowTos)