Use Linux Programming (Putty)Send me the output and source by screenshot step by
ID: 3675980 • Letter: U
Question
Use Linux Programming (Putty)Send me the output and source by screenshot step by step
#####Problem 12
1.Create a script name ShiftThemAgain
2.Put in the following comments at the top of your script
a.Program Name:
b.Programmer Name:
c. Today’s Date:
3.Open vi editor
4.Type the following lines of code to create a script that shifts the parameters two times:
echo $1 2 $3 $4 $5 $6 $7 $8 $9
shift 5
echo $1 2 $3 $4 $5 $6 $7 $8 $9
shift 2
echo $1 2 $3 $4 $5 $6 $7 $8 $9
5.Save and close vi
6.Type chmod ugo+x ShiftThemAgain and press Enter
7.To execute the script, type ShiftThemAgain 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 and press Enter
8.Rerun the script and pass 16 different values to it on the command line
9.Provide print screens
#####Problem13
1. Create a script name ColorRed
2. Put in the following comments at the top of your script
a.Program Name:
b. Programmer Name:
c. Today’s Date:
3.Insert the following code:
#!/bin/bash
Declare Color
Read –p “Enter color: “ Color
If [[ $Color = “red” ]]
Then
Echo “The color is read”
Else
Echo “The color is not read – it is “ $Color
Fi
4. Save the script, and then quit vi
5.Make the script executable, then execute it
6.Type red when prompted to enter a color
7.Execute the script again. Type blue when prompted to enter a color
8.Provide print screens
Explanation / Answer
12.
#!/bin/bash
# My first script
echo "ShiftThemAgain!"
echo "Program Name:"
echo
w # show the name of the program
echo # start the program
echo "Programmer Name:"
echo
w # show who is logged on and
echo # what they are doing
echo "Today’s Date:"
variable
Date =" " # set a local shell variable
echo "And this is a number: $VALUE" # display content of variable
echo
%vi Program Name
echo $1 2 $3 $4 $5 $6 $7 $8 $9
shift 5
echo $1 2 $3 $4 $5 $6 $7 $8 $9
shift 2
echo $1 2 $3 $4 $5 $6 $7 $8 $9
:q<Return>
chmod [ugo+x]... ShiftThemAgain-MODE... FILE...
$ ./my-shell-script.sh & ShiftThemAgain 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
press Enter
sudo !!
$ gnome-screenshot
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.