The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 02-09-2008
HPAVC's Avatar
HPAVC HPAVC is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 106
My homework was never this much fun. You have to do this all in bash or what exactly?

PHP Code:
#!/usr/bin/perl                                                                                                              

use strict;
use 
warnings;

while(
my $line = <STDIN>) {
    print 
join(" "sort(split(/s+/, $line))) . "\n";


Last edited by HPAVC; 02-09-2008 at 08:16 PM..