Dup Goto 📝

CatCommand

PT2/aw/editor/misc 07-31 13:46:45
To Pop
9 lines, 70 words, 431 chars Monday 2023-07-31 13:46:45

When writing short shell scripts or short Python scripts, I often challenge myself by typing

$ cat > myscript.py
import sys,os,re
from glob import glob
# and basically attempt to write the whole script correctly at the first attempt,
# with vim being only the backup plan

Basically this cat > filename construct takes everything you type up until a Ctrl-D on a blank line, which signifies end-of-file