Skip to content

Instantly share code, notes, and snippets.


Created Sep 26, 2014
What would you like to do?
function generator() {
local I=1
while [ $I -le 50 ]; do
echo "Line $I"
let I+=1
function alternator() {
local LN=0
while read -r LINE; do
test $((LN % 2)) -eq 0 && echo "$LINE" || echo "$LINE" 1>&2
let LN+=1
generator | alternator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.