Try the following:
PHP Code:
#!/bin/bash INPUT=$1
usage(){ echo "Usage: $0 input.txt" exit 1 }
die(){ echo "$@" exit 2 } [ $# -ne 2 ] && usage
[ ! -f "$INPUT" ] && die "File $INPUT does not exist!"
while read line do echo "$line" | grep -o . | sort -n |tr -d '\n'; echo "" done < "$INPUT"
Quote:
|
Thanks as always for your forum and professionalism.
|
You're welcome!
__________________
Vivek Gite
Linux Evangelist
 Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
 Always use CODE tags for posting system output and commands!
 Do you run a Linux? Let's face it, you need help
Last edited by nixcraft; 07-02-2009 at 01:46 PM.
Reason: See below
|