Changes

Jump to: navigation, search

OPS245 Lab 4

23 bytes added, 20:47, 23 January 2021
m
Using getopts Function & case statement: - moving links
#You will be using your '''c7host''' machine for this section.
#Open a shell terminal, and login as use <b><code><span style="color:#3366CC;font-size:1.2em;">sudo -i</span></code></b> to start a rootsession.
#Change to the '''/root/bin''' directory.
#Download, study, and run the following shell script. Issue the command:<br><b><code><span style="cursor:default;color:#3366CC;font-size:1.2em;">wget https://ict.senecacollege.ca/~ops235peter.callaghan/ops245/labs/user-create.bash</span></code></b>
#Try to understand what these Bash Shell scripts do, and then run the script as root to create just one user called '''test'''. After running the shell script, view the contents of the '''/home''' directory to confirm.
<ol><li value="6">Open a Bash shell terminal and login as root.</li><li>Change to the '''/root/bin''' directory.</li><li>Use the wget command to download the input file called user-data.txt by issuing the command:<br><b><code><span style="color:#3366CC;font-size:1.2em;">wget https://ict.senecacollege.ca/~ops235peter.callaghan/ops245/labs/user-data.txt</span></code></b></li><li>View the contents on the user-data.txt file to confirm there are 3 fields (username, fullname, and e-mail address)which are separated by the colon (:) symbol.</li><li>Use a text editor (such as <b><code><span style="color:#3366CC;font-size:1.2em;">vi</span></code></b> or <b><code><span style="color:#3366CC;font-size:1.2em;">nano</span></code></b>) to create a Bash Shell script called: <b><code><span style="color:#3366CC;font-size:1.2em;">createUsers.bash</span></code></b> in the /root/bin directory.</li><li>Enter the following text content into your text-editing session:</li></ol>
<code style="color:#3366CC;font-family:courier;font-size:.9em;margin-left:20px;font-weight:bold;">
<br>
932
edits

Navigation menu