Stack: Difference between revisions

Content deleted Content added
Rahul (talk | contribs)
Rahul (talk | contribs)
Line 733: Line 733:
push() {echo $1 >> stack}
push() {echo $1 >> stack}
pop() {tail -1 stack; (cat stack |head -n -1)|sponge stack}
pop() {tail -1 stack; (cat stack |head -n -1)|sponge stack}
empty() {cat stack |wc -l}

Usage:
Usage:
push me; push you; push us; push them
push me; push you; push us; push them