Please can some one help me. I need to know how to create a Bourne shell script
ID: 3640897 • Letter: P
Question
Please can some one help me. I need to know how to create a Bourne shell script for UNIX.Here are the requirements for this assignment:
Create a Bourne shell script. The script should do the following:
1. Explain what the script will do and who is the author in a comment area.
2. cd to your home directory
3. Show your current working directory.
4. List the contents of the current directory.
5. Create the directory structure and create the files as defined in the previous Individual Project.
6. For each directory and file, test to see if the file or directory already exists; if it does exist, do not recreate; if it is missing, create it.
7. In the end, generate a directory listing showing the structure and content of the new directories.
8. At the beginning of the script, set a variable called INSTALL_DIRECTORY that will contain the location of the directory that the Web server will be installed into. At the end of the script, display the contents of this variable along with a message to the installer about the location that the directories were created in.
Thank you very much for your help.
Explanation / Answer
#!/bin/ksh # ------------------------------------------------------------------------------ # Script Name: script.ksh # # Description: explain here what the script will do and the author of the script cd homedirectory echo "present working directory is $PWD" ls -ltr #List the contents of the current directory. if [ -a ${FILE} ] then rm -f ${FILE} fi touch ${FILE}