Write a bash script that takes two inputs

Assignment Help JAVA Programming
Reference no: EM131554127

Writing a few scripts

Part 1 - Bash Scripting

Write a bash script that takes two inputs, a directory path and the name of a text file that will be used for output.

The script should list the contents of the specified directory and output the permissions, file size, and filename of each file in the directory into the output text file.

Run the script on the var and sys directories and save the two outputted text files.

HINT: It may be useful to use the tr command to reduce the number of white spaces embedded in the output of the ls -l command.

Part 2 - Python Scripting

Write a Python script that takes two inputs, a directory path and the name of a text file that will be used for output.

The script should recusively search through the contents of the directory and add up the file sizes of each file to get a total directory size. The script should output the name of each file in the directory on a new line with the total directory size and directory path outputted after the files.

Run the script on the var and sys directories and save the two outputted text files.

Part 3 - Powershell Scripting

Write a Powershell script that takes two inputs, a directory path and the name of a text file that will be used for output. This script should perform the same function as the Python script.

The script should recusively search through the contents of the directory and add up the file sizes of each file to get a total directory size. The script should output the name of each file in the directory on a new line with the total directory size and directory path outputted after the files.

Run the script on the C:\Windows\boot directory and save the two outputted text files.

Part 4- Finish
Write the remainder of a shell script that given both a directory path and a number of files will loop from 1 to the number and create a text file named #.txt in the specified directory.
if [ "$1" == "" ] || [ "$2" == ""]
then
Usage: ./quiz.sh [directory] [number]
Example: ./quiz.sh /ouput 4
else
# your code here
fi
For instance, the example described would result in a directory named "output" containing the text files 1.txt, 2.txt, 3.txt, 4.txt

Reference no: EM131554127

Questions Cloud

Discuss the major steps involved in implementing a program : Discuss the major steps involved in implementing a program or project and identify some of the problems that can arise with each.
Major it project and explain the importance : Identify the main steps or phases involved in a major IT project and explain the importance and value of each step.
How much is interest earned on interest : Consider a $5,100 deposit earning 9 percent interest per year for 9 years. What is the future value? How much is interest earned on interest?
Ntify and discuss several global creative organizations : ntify and discuss several global creative organizations using the criteria and descriptions in Ch. 10 and 11 of Mastering Leadership.
Write a bash script that takes two inputs : Write a bash script that takes two inputs, a directory path and the name of a text file that will be used for output - Write a Powershell script
Statement of scope with requirements : Essential sections of any project plan are its Charter, and the Statement of Scope with Requirements.
Find the area of the park : There a park in the shape of a rhombus one of the side is 5 units in length .There are two gates exactly at the mid points of two adjacent walls of the park.
Popularity and variety of mobile devices : The popularity and variety of mobile devices such as phones, smartphones, tablets, PDAs, and others has complicated the computer forensics arena.
Find the optimal solution for the primal problem : Use the complementary slackness property and the optimal solution for the dual problem to find the optimal solution for the primal problem.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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