I found this little code which I put in a .bash_profile file
lenFunc() {
echo ${#1}
}
alias len=lenFunc
Typing actg
in terminal outputs 4
.
I then learned that echo actg|rev
outputs gtca
. However, I have troubles creating an alias from it.
Neither of these two works for me:
alias revFunc() {
echo ${#1}|rev
}
alias rev=renFunc
and
alias rev='echo "$1"|rev'
Help is appreciated!
(bonus: if anyone knows a way I can upgrade and also have a "revcom" command for reverse complementary I'll give you a virtual hug)
I run macOS if it matters.
Thanks for the quick reply! Works perfectly.