Question: Using VIM on Ubuntu For your first assignment you are going to create a simple bash script. Before you start, you should have a C++

Using VIM on Ubuntu

For your first assignment you are going to create a simple bash script.

Before you start, you should have a C++ program in a file stored in your home directory. The file should be named main.cpp. It should be the same program you did with your partner last week.

The script should begin by displaying the current directory where the script is located. After that, it should display the contents of that directory. The script will be creating a file system for your assignments. It should create a directory called CS018 inside of your Documents directory and a directory called Assignments inside the CS018 directory. The script should then copy the file named main.cpp located in your home directory to the Assignments directory. Next, display the first 20 lines of the main.cpp file. After that, run the command to display every line (including line numbers), containing a cout statement. After that it should then compile the C++ program. The executable file should be named sample.exe instead of a.out. Next, make sure to run the executable file. After that display the last 7 lines of your C++ program.

The script should work no matter which directory your script is located in. Once the script ends the current working directory should be the same directory you were in when you ran the script. Your script should also display what part of the script it is currently performing. Add a 2 second pause between each part of the script by using the sleep command.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!