Last login: Thu Nov  8 12:21:31 on ttys018
Math-Tuttle-OSX:~ smtuttle$ cd humboldt/f12cs279/279lectures/279lect12-2
Math-Tuttle-OSX:279lect12-2 smtuttle$ emacs moo-funct-play.sh 

[1]+  Stopped                 emacs moo-funct-play.sh

Math-Tuttle-OSX:279lect12-2 smtuttle$ moo-funct-play.sh
script action STARTS here
calling moo5:
*******************
moo moo moo moo moo
*******************
calling moo5 again:
*******************
moo moo moo moo moo
*******************
script action ENDS here

Math-Tuttle-OSX:279lect12-2 smtuttle$ fg
emacs moo-funct-play.sh

[1]+  Stopped                 emacs moo-funct-play.sh

Math-Tuttle-OSX:279lect12-2 smtuttle$ moo-funct-play.sh
script action STARTS here
calling moo5:
*******************
moo moo moo moo moo
*******************
calling moo5 again:
./moo-funct-play.sh: line 15: syntax error near unexpected token `echo'
./moo-funct-play.sh: line 15: `echo "script action ENDS here"'

Math-Tuttle-OSX:279lect12-2 smtuttle$ fg
emacs moo-funct-play.sh
Math-Tuttle-OSX:279lect12-2 smtuttle$ emacs just-moo5.sh 

[1]+  Stopped                 emacs just-moo5.sh

Math-Tuttle-OSX:279lect12-2 smtuttle$ source just-moo5.sh
Math-Tuttle-OSX:279lect12-2 smtuttle$ moo5
*******************
moo moo moo moo moo
*******************

Math-Tuttle-OSX:279lect12-2 smtuttle$ fg
emacs just-moo5.sh

[1]+  Stopped                 emacs just-moo5.sh

Math-Tuttle-OSX:279lect12-2 smtuttle$ use-moo5.sh
about to try to call moo5:
*******************
moo moo moo moo moo
*******************
after call to moo5

Math-Tuttle-OSX:279lect12-2 smtuttle$ moo5
*******************
moo moo moo moo moo
*******************

Math-Tuttle-OSX:279lect12-2 smtuttle$ fg
emacs just-moo5.sh

[1]+  Stopped                 emacs just-moo5.sh
Math-Tuttle-OSX:279lect12-2 smtuttle$ fg
emacs just-moo5.sh

[1]+  Stopped                 emacs just-moo5.sh

use-moMath-Tuttle-OSX:279lect12-2 smtuttle$ use-moo-functs.sh
about to try to call moo5:
*******************
moo moo moo moo moo
*******************
after call to moo5
--------------------------
about to moo at Sharon
Dear Sharon, MOO!
about to moo at Thomas
Dear Thomas, MOO!
about to call say5
******************
baaa baaa baaa baaa baaa
******************
******************
meow meow meow meow meow
******************
about to call lookit_args
number of my args: 2
my args are: hello world
$0: ./use-moo-functs.sh
number of my args: 0
my args are: 
$0: ./use-moo-functs.sh
number of my args: 10
my args are: 1 2 3 4 5 6 7 8 9 10
$0: ./use-moo-functs.sh

Math-Tuttle-OSX:279lect12-2 smtuttle$ fg
emacs just-moo5.sh

[1]+  Stopped                 emacs just-moo5.sh
Math-Tuttle-OSX:279lect12-2 smtuttle$ source just-moo-functs.sh

Math-Tuttle-OSX:279lect12-2 smtuttle$ lookit_args sheep
number of my args: 1
my args are: sheep
$0: -bash

Math-Tuttle-OSX:279lect12-2 smtuttle$ emacs scope1.sh

[2]+  Stopped                 emacs scope1.sh

Math-Tuttle-OSX:279lect12-2 smtuttle$ scope1.sh alpha beta
Script was called with alpha beta
x is 1
myfunct was called with : 1 2 3
x is 2

Math-Tuttle-OSX:279lect12-2 smtuttle$ fg
emacs scope1.sh

[2]+  Stopped                 emacs scope1.sh

Math-Tuttle-OSX:279lect12-2 smtuttle$ scope1.sh gamma delta
Script was called with gamma delta
x is 1
y is 
myfunct was called with : 1 2 3
x is 2
y is 13

Math-Tuttle-OSX:279lect12-2 smtuttle$ source scope1.sh
Script was called with 
x is 1
y is 
myfunct was called with : 1 2 3
x is 2
y is 13

Math-Tuttle-OSX:279lect12-2 smtuttle$ echo $y
13

Math-Tuttle-OSX:279lect12-2 smtuttle$ myfunct shh oink
myfunct was called with : shh oink

Math-Tuttle-OSX:279lect12-2 smtuttle$ x=47
Math-Tuttle-OSX:279lect12-2 smtuttle$ echo $x
47

Math-Tuttle-OSX:279lect12-2 smtuttle$ myfunct shh oink
myfunct was called with : shh oink

Math-Tuttle-OSX:279lect12-2 smtuttle$ echo $x
2

Math-Tuttle-OSX:279lect12-2 smtuttle$ x=34
Math-Tuttle-OSX:279lect12-2 smtuttle$ echo $x
34

Math-Tuttle-OSX:279lect12-2 smtuttle$ myfunct meow arf | tee check.txt
myfunct was called with : meow arf

Math-Tuttle-OSX:279lect12-2 smtuttle$ more check.txt
myfunct was called with : meow arf

Math-Tuttle-OSX:279lect12-2 smtuttle$ echo $x
34
Math-Tuttle-OSX:279lect12-2 smtuttle$