As you complete each of the following steps, keep track of what occurs at each p
ID: 3556836 • Letter: A
Question
As you complete each of the following steps, keep track of what occurs at each point, including what you type, the output given, and any errors experienced. Submit this information in a log to your instructor for this weeks assignment. Your log can use the sample format provided, or you can create your own. 1. In the same folder as last week, create a new file titled week4prog1[name].scr. 2. Change the permissions on this new file to add the execute bit for user, group, and owner. 3. Run the following script: a. #!/bin/bash b. count=1 c. echo "start of the program" d. while [ $count -le 10 ] e. do 1) echo "Loop #$count" 2) sleep 10 3) count=$[ count + 1 ] f. done g. echo "end of the program 4. Modify the program to add a trap for SIGINT and SIGTERM. 5. Save the script and then run the script in the background. 6. Use the jobs command to display a list of the jobs currently running. 7. Find the process id of the script and kill the job. 8. Check to see if you get the trap message. 9. Run the script again using the at command to schedule the job in the future. Wait for the job to run to make sure it executes.
Explanation / Answer
1. Open a terminal.
Gain access to terminal from the redhat screen
[student@bsit_rh62 ~]$
2. Create a new group called mygroup. Hint: /usr/sbin/groupadd.
Had many errors, but a lot of group id errors
[student@bsit_rh62 sbin]$ sudo groupadd -g 001 mygroup
[sudo] password for student:
groupadd: GID '1' already exists
[student@bsit_rh62 sbin]$ sudo groupadd -g 002 mygroup
groupadd: GID '2' already exists
[student@bsit_rh62 sbin]$ sudo groupadd -g 2012 mygroup
3. Create a new folder and name it your first name.
I forgot to put sudo the first time, and then when I copied I reverted to my Windows knowledge
[student@bsit_rh62 sbin]$ mkdir name
mkdir: cannot create directory `name': Permission denied
[student@bsit_rh62 sbin]$ sudo mkdir name
[student@bsit_rh62 sbin]$ ^C
[student@bsit_rh62 sbin]$
4. Get a directory listing of the home folder using the long listing format.
Home directory and little information
[student@bsit_rh62 sbin]$ ls /home
student student2 tmp
[student@bsit_rh62 sbin]$
5. Modify the permissions on your new folder to set read, write, and execute permissions for the user and group.
Had some issues and then realized that I just needed to do the sudo again for this one
[student@bsit_rh62 sbin]$ chmod a+rwx /home
chmod: changing permissions of `/home': Operation not permitted
[student@bsit_rh62 sbin]$ sudo chmod a+rwx /home
[sudo] password for student:
[student@bsit_rh62 sbin]$
6. Get a directory listing of the new folder using the long listing and human readable format. (ls
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.