unix - bash: how to redirect the result in to another file -
now have code, can show result on terminal
cat temp | sort -n | uniq -c | awk '{ print $2, $1 }'
but how can redirect file?
i tried echo temp | sort -n | uniq -c | awk '{ print $2, $1 }' > temp2
, not working
thanks
echo temp | sort -n | uniq -c | awk '{ print $2, $1 }' > temp2
you used echo:
cat temp | sort -n | uniq -c | awk '{ print $2, $1 }' > temp2
also don't need use cat:
sort -n temp | uniq -c | awk '{ print $2, $1 }' > temp2
Comments
Post a Comment