Is there a preference or a best practice or doesn't it matter. I know I can do it as a one liner from a system call but I want to learn bad habits. Dobby.
...but I want to learn bad habits
Wow, so many to choose from. Smoking, not using strict, leapfrogging unicorns (bad, but not always practical - substitute rhinos if unicorns are unavailable) not wearing pants to work...
I think bad habits are called that for a reason, but hey, do what you need to do.