How can I create and open a file from terminal with a single command?

shell

Solution

in .bashrc

lazytouch()
{
  touch $1
  open $1
}

then type

$ lazytouch anything.really

Problem

To create a file from terminal I type the following... ``` $ touch filename.py ``` To open the file I just created from terminal, I then type... ``` $ open filename.py ``` I'm curious to know if there is a terminal command that does both...create and then open (I'm super lazy).

Original source