Changes

Jump to: navigation, search

Talk:Fall 2008 SPR720 Sample Exam Questions

4 bytes added, 02:08, 11 December 2008
no edit summary
Here are some sample questions to aid you in exam preparation. '''Feel free to discuss the answers on the ''discussion'' page (see link above).'''
===1. What will the output of this script be?===
#!/bin/bash
done
===ANSWER:===
<pre>
ireland
Nes
===2. What will the output of this script be?===
#!/bin/bash
done
===ANSWER:===
<pre>
one three
===3. What will the output of this script be?===
#!/bin/bash
echo "exrxzW" | tr "A/blCedxEzfrGyhoI=JW" "8qC3pSDehcTngi#TNrIa"
===ANSWER:===
<pre>
Seneca
# say, if u pipe is "A/B", then out put is "8qC", if the pipe is "ACxEW", then output will be "8peha"
===4. What will the output of this script be?===
#!/bin/bash
done
===ANSWER:===
<pre>
0^2= 0
Nes
===5. Here is a Makefile:===
a: b c
If the command "make d" is entered, what commands will ''make'' execute? Explain why.
===ANSWER:===
<pre>
It will call up the function "d" in Makefile, and function "d" will call-up function "a", then function "a" will run print out the content of file "b" and "c" into a file called "a"
Nes
===6. Write a python script which will ask the user for the name of a virtual machine and report whether that virtual machine is running. (Use libvirt).===ANSWER===
<pre>
Nes: edit at 00:53, as CT suggested.
===7. Write a bash script which will print all of the files in your home directory which end in .ps -- you must be able to run the script from any directory.===
<PRE>
#!/bin/bash
17. Describe what the PATH environment variable does. Write the syntax to add the directory "/usr/local/bin" to the PATH as the first directory searched.
===18. What will this command do to the existing file "ocean"? date >ocean=== 18 Answer ===
<pre>Nes: It will redirect standard output of command "date" to the file "ocean". The file "ocean" iwll be replaced.
</pre>
===19. What will this command do to the existing file "sea"? date >>sea===
Answer

Navigation menu