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.txt
Code language: CSS (css)

About Ricard Torres

Senior Front-end Software Engineer at Netcentric, from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.

@ricard_dev @ricard_dev

📝 Blog 🎙 Podcast

Leave a Reply

Add <code> Some Code </code> if you need to.