remove extra whitespaces
#!/bin/bash
# removes all "extra" whitespace (leaves normal spaces)
cat "web.txt" | awk '{$1=$1}1'
# removes only leading and trailing whitespace
cat "web.txt" | awk '{gsub(/^ +| +$/,"")}1'
# this perl command should do the same thing
cat "web.txt" | perl -lape 's/^\s+|\s+$//g'