I use a lot of aliases and functions in Bash. Today I defined the
following alias:
alias zypper_ps="zypper ps | awk 'BEGIN { FS = \"|\" } ; { if (NR > 4) {if (\$5 !~ /^[ ]*$/) print \$5} }' | sort | uniq"
I think that in this case an alias is the right way to do it. But I
was wondering are there rules of thumbs when to use an alias and when
a function. (Of-course if you need a parameter, you need a function.)
And is there a (significant) difference in performance?
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
Replies