CMIT 391 Name:___________________________ Get the combos.cpp file from: wget http://sensei.asia.umuc.edu/dwills/cmis160/Programs/combos.cpp Compile it with g++ to 'combos' Run it, input 5 and 3 as the n and r values. Run it with 5 and 3 as its command line arguments. Run it with 10 and 5 as its command line arguments. piping that into wc, how many combinations are there: _________ piping into head, what is the first output:________ piping into tail, what is the last output: ________ piping into sort and head/tail what are the first and last in sorted order:_________ __________ Using ldd, what libraries does this program use: _________________ Download the ANSI terminal control example programs and compile and run them. What libraries do these programs use that combos does not: ___________ Download the Curses example programs and compile and run them. What libraries do these programs use that combos does not: ___________ Which programs in /bin use curses:________________ Hint: for loop useful here. use ldd and grep in pipeline Download the Xlib example program and compile and run it. What libraries does this program use that combos does not: ___________ Download the pinglan script. What does the file command indicate it is:___________________ Make it executable and then run it (for a minute or so) What's the MAC/hardware address of 192.168.0.1 :___________________________ What's the Windows NetBios name of 192.168.0.12 :____________________ How many 'commands' in /usr/bin are scripts:________ How many 'commands' in /usr/bin are Bourne shell scripts:________ How many 'commands' in /usr/bin are Bourne-Again shell scripts:________ What other kinds of 'script' are in /usr/bin:___________________ Hint: file's output is : separated. file -N doesn't "pad" the output. sort -b ignores leading spaces. What are the different file types in /usr/bin: (skip the symbolic links): ____________________________ Which are the ASCII English text files in /usr/bin: ______________ The bash 'help' command lists the 'commands' that are built-in to bash. The bash_builtins file on the class web site contains the list of these builtin-in commands. Which bash builtins are also the name of commands in your PATH of directories? for i in `cat bash_builtins` ;do which $i 2>/dev/null ;done _______________________________ When one of these command names is issued, it is the builtin that is done. How to have the file executed instead?:____________________________ Interactively create a shell function named calc2: function calc2 { echo "$*" | bc -l; } Paste the output of 'declare -f calc2': ______________ Use it to calculate 1234*1234/4321+sqrt(999):___________ Add the l, lt, and calc functions from the "Basic compiling..." file to your .bashrc. Execute the .bashrc in the current shell by: . .bashrc Notice the leading dot, this means execute the file in the current shell. (i.e. do not have a sub-shell spawned to run in it as this will not effect the current shell when the sub-shell exits) Paste the output of 'declare -f l': _________________ Use the l command.