Question: Set up the script and create an input file First, create a Bash shell script that contains the following commands. Name it mod 9 .
Set up the script and create an input file
First, create a Bash shell script that contains the following commands. Name it modsh
You can copyandpaste this code if you want to Lines that begin with the # symbol are comment lines; it's your choice whether you want to include them inside your script file.
#binbash
# Get commandline arguments
infile$
outfile$
# Get the first characters of the input file and place
# them into the output file note: this is the same dd
# command from pages of Linux Basics for Hackers
dd if$infile of$outfile count bs
# Append an endofline character to the output file
# note: you need not just in this case!
# would clear the output file's old contents.
echo
$outfile
# Send the contents of the output file to standard output
cat $outfile devstdout
# Send a confirmation message to standard error
echo 'Output file has been created.devstderr
exit # this last line isn't required, but it's good practice
Once this script is created, make it executable chmod ux modsh is a good command for this
Next, run the following command to create a text file that is exactly characters long.
echo 'This is a text file that happens to be exactly characters long. Use it well.char.txt
Create a file containing your results
Now start a new LibreOffice Write or Word document, or open a new text file. The file name does not matter. This is the only file that you need to submit on Canvas.
In the file, write what you see when you run this script with each of the following commands. You can copy output from the console into your file, or you can write English text to summarize what you can see; it's your choice.
modsh char.txt out
modsh char.txt out devnull
modsh char.txt out devnull
modsh devzero out
modsh devrandom out
if this command stalls or stops working, press CtrlC or CommandC on your keyboard to stop the command
modsh devurandom out
Also, answer the following two questions in your output file.
Did anything about the output from any of these commands surprise you? If so what?
Is there anything about the script or these devices that you are confused about or that you would like to learn more about? No is an acceptable answer.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
