Grep review for the morning: Examples including a variable of type int Checking to see if the NVIDIA video driver is used Check to see which computers in MLH 310 are running Linux Shell Variables: A variable you can use in a shell Example: DISPLAY Log into another machine and try it Setting with export $ to use later This will expand the variable name Demo with parameter printing program "expand" here can make it bigger or smaller A couple more that might be good to know: PS1 PATH run export with no paramters to list them all alias: It lets you have a different name for a command Good for tricks Overview of what I use alias for in .profile Continuation from last time functions: These take parameters, and can call each other Using a function vs. a script: script can be run as a program script can be moved around easily script runs as a child of the shell Try cd inside it, or setting a shell variable A lot of the time, you have a choice here What happens if you make a bad mistake? You can install a new .profile in some non-shell-using way This can be harder than it looks! Like yesterday... How do they look on the inside? getenv function C interlude: C strings vs. C++ strings Arrays of characters vs. an object Have you used C++ strings much? They've got methods people like NOT like C strings There are library functions to do that stuff with C strings Couple important ones: strcmp strlen strcpy / strncpy (and security) strstr sprintf Ok, couple examples Figure out if the string has a squirrel in it Count the letters (not characters) in a string system function Directories for binaries: Since we know how to write program, and adjust PATH Usually called either bin or .bin .bin is omitted from regular ls results ("hidden") Python getenv: Easy to use, as usual