I\'ve a command that works just fine at the command line, but not when I try to put it in an alias or function.
$ awk \'{print $1}\' /tmp/textfile 0 <
$ awk \'{print $1}\' /tmp/textfile 0
Use a function instead of alias
myfunc(){ awk '{print $1}' file; }
You need to escape the $ like so:
$
alias a="awk '{print \$1}' /tmp/textfile"
Otherwise your alias is:
awk '{print }' /tmp/textfile
Which prints the whole file...