View Single Post
  #4 (permalink)  
Old 06-27-2009, 03:33 AM
nixcraft's Avatar
nixcraft nixcraft is offline
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,674
Thanks: 11
Thanked 240 Times in 180 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Try the following:

PHP Code:
#!/bin/bash
INPUT=$1

usage
(){
    echo 
"Usage: $0 input.txt"
    
exit 1
}

die(){
    echo 
"$@"
    
exit 2
}
[ $
# -ne 2 ] && usage

[ ! -"$INPUT" ] && die "File $INPUT does not exist!"

while read line 
do
    echo 
"$line" grep -. | sort -|tr -'\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
Reply With Quote
The Following User Says Thank You to nixcraft For This Useful Post:
jaysunn (06-27-2009)