Let's assume you need to strip all leading whitespaces from a file and you found the following handy Perl script to do exactly that:
$ cat sample.txt | perl -lpe 's/^\s*//'
As it turns out, you don't have Perl installed on your working machine. What can you do? Install Perl on the machine? Well, that would certainly be an option, and it's exactly what most developers or system admins do. But wait a second, you already have Docker installed on your machine. Can't we use Docker to circumvent the need to install Perl? Yes, we can. This is how we're going to do it:
- Create a folder, ch07/simple-task, and navigate to it:
$ mkdir -p ~/fod/ch07/simple-task && cd ~/fod/ch07/simple-task
- Open VS Code from within this folder:
$ code .
- In this folder, create a sample.txt file with...