Lab 05 - Dropbox Questions

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Lab 05 – Questions for Dropbox

Navpreet Kaur
Student:

10270950
Student ID:

Section: 2

Please provide detailed answers to the following questions IN YOUR OWN WORDS. Do
NOT copy/paste from the internet, the lab itself, or from each other!

• I have “chmod’ed” the file “myscript. sh” with the command chmod 644
myscript. sh
• What permissions does ‘myscript. sh’ now have?
Ans- The user and group own the 'myscript. sh' as the file can be viewed and read by the
user and this file can also be seen by anybody else.
• Which permission “group” gets priority?
Ans- The priority of reading can be assessed by groups
• When I type ./myscript.sh will my script run? Why or why not?
Ans- The content does not have permission to be used therefore it will not run or execute.

• Attach a screenshot that clearly shows:


• Your name at the top of the Ubuntu Server VM window
• the output from your input.sh script with numbers OTHER THAN 5 and 4 (replace
the example below)

• You’ve written a script in Linux. WITHOUT actually running it, how else can you
tell if it will run or not? List 2 different ways.
Ans- 1 Method - Bash can validate a script's syntactical validity without running it when
we use the -n option.
2 Method - Another choice is to organize ypur code into functions. You can then run
your code and then check your syntax mistakes.
• Attach a screenshot that clearly shows:
• Your name at the top of the Ubuntu Server VM window
• The (combined) output from the cat contacts.txt and find <value> commands
from Part D (replace the example below)

• Attach a screenshot of your Linux VM window (just the VM window – not the whole
desktop!) that clearly shows:
• Your name at the top of the Ubuntu Server VM window
• All of the visible output from the “LAST ACTIVITY” script
• Your user prompt at the bottom – replace the example below (and make sure I’m
able to read it!)

• Explain, in your own words, what this script does.


Ans- It will be stopped by pressing cntrl+c as it starts to play infinite loop.
Lab questions must be submitted to Dropbox before midnight (EST) on the day of your lab

Labs submitted late receive a mark of ZERO. No exceptions.

You might also like