Stack: Difference between revisions
→{{header|UnixPipes}}
m (<lang>) |
|||
Line 728:
(else 'badmsg)))))
</lang>
=={{header|UnixPipes}}==
Uses moreutils
init(echo > stack)
push() {echo $1 >> stack}
pop() {tail -1 stack; (cat stack |head -n -1)|sponge stack}
Usage:
push me; push you; push us; push them
pop;pop;pop;pop
them
us
you
me
|