Question: How do I program my Mac's `F19` key to automatically type a text when I press it?

Answer: 
You can use GNU sed:

```
sed -i -e "/^$/d" su.txt

```

Will delete blank lines. 

---

If you're on a BSD variant or OS X, use this instead:

```
sed -i '' -e "/^$/d" su.txt

```

Here, `-i` takes an *extension* as an argument – using the GNU sed syntax would result in a file `su.txt-e` being created.
This can be achieved by using grep:

```
grep . file

```

Or try the [ex](https://en.wikipedia.org/wiki/Ex_(text_editor))-way (cross-platform compatible):

```
ex -s +'v/\S/d' -cwq test.txt

```

For multiple files (edit in-place):

```
ex -s +'bufdo!v/\S/d' -cxa *.txt

```

Note: The `:bufdo` command is not [POSIX](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ex.html).

Without modifying the file (just print on the standard output):

```
cat test.txt | ex -s +'v/\S/d' +%p +q! /dev/stdin

```