Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Stack/UnixPipes/stack-1.up
Normal file
11
Task/Stack/UnixPipes/stack-1.up
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
init() { if [ -e stack ]; then rm stack; fi } # force pop to blow up if empty
|
||||
push() { echo $1 >> stack; }
|
||||
pop() {
|
||||
tail -1 stack;
|
||||
x=`head -n -1 stack | wc -c`
|
||||
if [ $x -eq '0' ]; then rm stack; else
|
||||
truncate -s `head -n -1 stack | wc -c` stack
|
||||
fi
|
||||
}
|
||||
empty() { head -n -1 stack |wc -l; }
|
||||
stack_top() { tail -1 stack; }
|
||||
6
Task/Stack/UnixPipes/stack-2.up
Normal file
6
Task/Stack/UnixPipes/stack-2.up
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
% push me; push you; push us; push them
|
||||
% pop;pop;pop;pop
|
||||
them
|
||||
us
|
||||
you
|
||||
me
|
||||
Loading…
Add table
Add a link
Reference in a new issue