Professional Documents
Culture Documents
Lab 7 Assignment
Name : Obaid Mubarak Alnuaimi – ID : 201503908
Objective:
Example 1
Write a shell script that prints out your name and waits for the user to press the [Enter] key
before the script ends.
#!/bin/bash
echo "Ahmed"
Example 2
Write a script to prompt for your name and then create a file with your ‘<name>_file’ as file
name.
#!/bin/bash
{USER_NAME}_file
Example 2:
This study source was downloaded by 100000876763978 from CourseHero.com on 11-30-2023 01:57:50 GMT -06:00
https://www.coursehero.com/file/40891514/OS-Lab7Assignment-Obaid-Alnuaimi-201503908docx/
Write a script that upon invocation shows the time and date and lists all logged-in users. The
script then saves this information to a logfile.
#!/bin/bash
DATE_TIME = $(date)
echo $DATE_TIME
$USERS
Example 3
#!/bin/bash
# Define variables
BACKUP="/CIT01"
NOW=$(date +"%d-%m-%Y")
echo
This study source was downloaded by 100000876763978 from CourseHero.com on 11-30-2023 01:57:50 GMT -06:00
https://www.coursehero.com/file/40891514/OS-Lab7Assignment-Obaid-Alnuaimi-201503908docx/
Homework:
After completion, upload the script as text file to Blackboard submission for grading.
This study source was downloaded by 100000876763978 from CourseHero.com on 11-30-2023 01:57:50 GMT -06:00
https://www.coursehero.com/file/40891514/OS-Lab7Assignment-Obaid-Alnuaimi-201503908docx/
This study source was downloaded by 100000876763978 from CourseHero.com on 11-30-2023 01:57:50 GMT -06:00
https://www.coursehero.com/file/40891514/OS-Lab7Assignment-Obaid-Alnuaimi-201503908docx/
Powered by TCPDF (www.tcpdf.org)