Create x empty files in a given directory

Assignment Help Computer Engineering
Reference no: EM132171520

Using the Linux Terminal

1. Write a script to check command arguments (3 arguments maximum). Display the argument one by one. If there is no argument provided, remind users about the mistake. If there an easy way to use a loop to get all arguments?

2. Write a script to display numbers from 1 to n, where n is an integer provided by users (if not, default to 10). Hint: use "read" command to accept user input.

3. . Write a script to display the following patterns on the screen. Number of rows and columns are taken from the command arguments; if they are missing, set default to 3 (rows) and 4 (columns). Hint: you will use a nested loop.

****

****

****

4. Create x empty files in a given directory (x is a number), following a naming format like this: myfile1, myfile2, etc. Ask the user to enter the first part file name and the number of files he/she wants to create. Hint: you may use the "touch" command to quickly create empty files. Take two screenshots:

a) Display the source code in an editor (Screenshot #4-1)

b) Execute your script in the terminal, and display the command and the result (Screenshot #4-2)

5. Write a script to create the following directory structure in a directory of user's choice. The user can supply the directory of choice as an argument; if missing, prompt the user to enter one from the command line. Take two screenshots:

a) Display the source code in an editor (Screenshot #4-3)

b) Execute your script in the terminal, and display the command and the result (Screenshot #4-4)

6. Edit the script in the prior question.

a) Check if the user input (an existing directory) is valid; if not, ask the user to enter it again.

b) If the "Data" directory exists, then prompt for user actions: cancel or overwrite. Hint: use directory operators.

Command line script on one line: read -p "Enter a number: " max; sum=0; for ((i=1; i<=$max; i++)); do let sum+=i; done; echo "The sum from 1 to $max is $sum" Data Image Cache.

Reference no: EM132171520

Questions Cloud

What financial statements are required to be prepared by tax : Assuming 4% of the gross tax levy will be uncollectible, What financial statements are required to be prepared by the tax agency fund
Oracle fusion applications : What are the advantages and disadvantages of Oracle Fusion Applications?
Index positions of all the vowels in the word : What is a function that takes as input a string and returns a list of the index positions of all the vowels in the word. A vowel is defined as any letter in
Discuss constraints of the global environment : How does the culture of an organization influence the quality of estimates? Discuss constraints of the global environment.
Create x empty files in a given directory : Create x empty files in a given directory (x is a number), following a naming format like this: myfile1, myfile2, etc.
Explain all potential advantages and disadvantages : The Rainspout Irrigation Company has a rain gate that is currently being manufactured using a plastic extrusion process and an assembly line using manual labor.
When personal selling crosses national boundaries : When expanding internationally, large companies such as Walmart. When personal selling crosses national boundaries,
Provide an overview of the problem or issue : Provide a realistic solution that will alleviate or improve the situation within context. This solution should be the main position of the essay and should
Create an array of six or more integers : Create an array of 6 or more integers. Then, you will prompt the user if they would like to see the sum of the even numbers or odd numbers from the array.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd