How to pass paramater to terminal alias

I use Oh My Zsh here's a quick tip to add an alias which accepts paramters.

Personally I use to do a git fetch and then a git checkout passing the name of the branch as a paramater.

function myAlias() {
     touch "$1"
     rm "$2"
 }Code language: JavaScript (javascript)

Then you juse use it like:

myfunction file1.txt file2.txtCode language: CSS (css)

Leave a Reply

Your email address will not be published. Required fields are marked *