# file name is given as command line (First argument) "$1"
# reverse sort file content based on line start with value "$2" supplied as command line argument (Second Argument)
#!/bin/bash
if [ -z $1 ] || [ -z $2 ]
then
echo "$0 : provide exact two argument "
exit 1
else
cat "$1" | grep "^$2" | sort -r
fi
# reverse sort file content based on line start with value "$2" supplied as command line argument (Second Argument)
#!/bin/bash
if [ -z $1 ] || [ -z $2 ]
then
echo "$0 : provide exact two argument "
exit 1
else
cat "$1" | grep "^$2" | sort -r
fi
No comments:
Post a Comment