#!/bin/bash

# ls -l /etc/ revealed a file /etc/matplotlibrc which is currently 32235 bytes

echo "(see stderr tab for actual results)"

# make sure the file is cached before the experiment
cat /etc/matplotlibrc >/dev/null

echo "*** with cat" >&2
time bash -c 'for n in {1..1000}; do cat /etc/matplotlibrc | wc -l; done >/dev/null'

echo "*** without cat" >&2
time bash -c 'for n in {1..1000}; do wc -l </etc/matplotlibrc; done >/dev/null'
