# demonstrate use of PATH variable 528 which ls 529 ls 530 cd cse374_demos/03/ 631 wget http://courses.cs.washington.edu/courses/cse374/15wi/lectures/lec3scripts.tar 632 tar xf lec3scripts.tar 532 cat make_thumbnail1 533 make_thumbnail1 mtn.jpg thumb.jpg 534 ls 535 echo $PATH 536 clear 537 PATH=$PATH:`pwd` 538 echo $PATH 539 make_thumbnail1 mtn.jpg thumb.jpg 540 ls thumb.jpg 541 ls # demonstrate variable assignment and export 542 course=cse374 543 echo $course 544 bash # in the child shell echo $course exit 545 export course 546 bash # in the child shell echo $course exit 547 clear 548 printenv 549 printenv | grep course 550 man env 551 man printenv 552 env 553 clear 554 i=10 555 j=20 556 k=$i + $j 557 k=$i+$j 558 echo $k 559 ((k=$i+$j)) 560 echo $k 561 ((k=i+j)) 562 echo $k 563 ((k=i+j+h)) 564 echo $k 565 vim makeNFiles 566 chmod +x makeNFiles 567 ./makeNFiles 568 ./makeNFiles 2 cse 569 vim makeNFiles 570 ./makeNFiles 2 cse 571 vim makeNFiles 572 ./makeNFiles 2 cse 573 vim makeNFiles 574 ./makeNFiles 2 cse 575 ./makeNFiles 2 cse 576 ls -l cse* 577 clear 578 for value in 2 4 6 8; do echo Count $value; done 579 for value in `seq 1 10`; do echo Count $value; done 580 ls 581 ls for filename in *; do echo $filename; done 582 clearn 583 clear # strings and quoting 584 echo m* 585 ls * 586 x=* 587 ls $x 588 echo x 589 echo $x 591 clear 592 echo * 593 echo "$x" 594 x=* 595 ls $x 596 echo '$x hello' 597 echo "$x hello" 598 echo $x hello # careful: if you have a typo, variable value defaults to empty 599 ops=7 600 ls $oops 601 ls # don't use set 602 man set 603 set foo=blah 604 echo $foo 607 ls 610 ((k=i+j)) 611 echo $k 612 ls 613 exit 614 history 615 history > lec4.history