This is not very smart, but might do the trick:
if [ -z $1 ]; then
echo "Needs filename as argument."
elif [ -f "$1" ]; then
while read a;
echo "$a" | sed -e "s+http://++" -e "s+@.*$++g"
done < "$fname"
* Save this as a shell script of a name you like, e.g. url-extract.sh
* Make it executable with chmod +x url-extract.sh
* Give your filename as the first argument:
and it returns only user
ass as you wanted