Using bash, enter the export command and the set command. Which set of variables is a subset of the other? What is the difference between the variables reported by export and those reported by set? Finally, enter which export. Where is the export command located?
Examine /etc/profile. How is the default
umaskset? What customizations are done in the file for system users?
Create a simple bash script using the
#!/bin/bashsyntax, set the executable mode bits, and execute the shell. If it runs correctly, add errors to see the diagnostic messages. Have the script report both exported and nonexported variables. Verify that the nonexported variables do not survive the startup of the new shell.
Create some bash aliases in your current shell. Start a new shell by running the command bash in your current shell. Do your aliases work in this child shell? Why or why not?
Create a MySQL table structure that could be used to store the fields in the file /etc/passwd. Write a shell script to parse this file, one line at a time, and call the mysql command-line program to insert the users defined in /etc/passwd into your table. Once this is complete, write a SQL query to list all usernames that have a shell of /bin/bash.