#!/bin/bash

# ideone boilerplate - we can't write files in the home directory;
# so create a temporary directory for our files instead
t=$(mktemp -d -t ideone.XXXXXXXXXXXX) || exit
trap 'rm -rf "$t"' ERR EXIT
cd "$t"

cat <<\: >a.txt
12
23
45
56
:

awk 'NR>1 { close(f) }
    { f=++n ".txt"; print >f }' a.txt

tail [1-9]*.txt