And if you stick it in a .sh you have pretty much created a special purpose program.
After having successfully located the snippet, only too often I have discovered that it does not do exactly what I want right now. Then I am left with the choice of changing the past script to also fit the new purpose, without destroying the previous work.
All this mental effort to save yourself three lines of typing seems a questionable endeavor. I have come to love the throwaway scripts.