I want to save the following commandline sequence as a bash alias:
grep `date '+%d/%b/%Y'` access.logs | egrep 2765330645ae47d292c9ceac725d744e.py |awk '{print $1, $4, $5, $7, $8, $9, $10}' | sort |uniq -c -w15 |sort -n
It works fine form the commandline, but fails when I try to set it as an alias. I tried adding the following to .bash_profile:
alias downloads="grep `date '+%d/%b/%Y'` access.logs | egrep 2765330645ae47d292c9ceac725d744e.py |awk '{print $1, $4, $5, $7, $8, $9, $10}' | sort |uniq -c -w15 |sort -n"
and I get the following errors:
-bash-3.2$ downloads
awk: {print , , , , , , 0}
awk: ^ syntax error
awk: {print , , , , , , 0}
awk: ^ syntax error
awk: {print , , , , , , 0}
awk: ^ syntax error
awk: {print , , , , , , 0}
awk: ^ syntax error
awk: {print , , , , , , 0}
awk: ^ syntax error
awk: {print , , , , , , 0}
awk: ^ syntax error
What am I doing wrong????