Reference no: EM132259913
Questions -
Q1. In a bash shell script, what are the required elements of an "if" control structure?
Q2. In a bash shell script, what are the optional elements of an "if" control structure?
Q3. In a bash shell script, what are the required elements of a "while" control structure?
Q4. What is the difference between a shell variable and environment variable? Which one is considered local and which is considered global?
Q5. List the four kinds of shell parameters/variables.
Q6. Of these four kinds, which kind do $, $_, $#, and $? Belong to?
Q7. What do $, $_, $#, and $? Represent?
Q8. Show the command that creates an alias named hi which lists the hidden files in the current directory.
Q9. Describe the actions that take place when a command ends with
|& file1
For example,
./myscript |& file1
Q10-Q21. Briefly describe the following Linux commands and acronyms.
10. ssh:
11. telnet:
12. traceroute:
13. TCP:
14. LAN:
15. DNS:
16. ftp:
17. ssh:
18. ping:
19. env:
20. g++:
21. gcc:
Q22. Show a command that will create a file named "etc.tar" in your home directory from recursively going through all of the files in the "/etc" directory. In other words, the "etc.tar" file will include the files in the "/etc" directory as well as all of its subdirectories. IMPORTANT: This command must work for any user as well as work from any directory.
Q23. In bash, multiple commands can appear on a single command line when they are separated by certain one to two character control operators. Excluding the newline command initiator, list five other control operators which separate commands.
Q24. Show a single compound command which first changes the permissions on a file named "mychess.conf" in the current directory so that you, your group, and everyone else are limited to read access only; Next, put the file named "mychess.conf" in the "/etc" directory and in the process rename it "chess.conf".
Q25. Show a single compound command which will look for the files "a" and "b" in the current directory, then will print "error: files are missing!" if either file does not exist or will print absolutely nothing if they both exist. Try it out on the command line to check your answer.