Giter Club home page Giter Club logo

bashscripts's Introduction

CS1XA3 Project 01 - mujtaa3

Usage

Make the script executable from the Project01 directory with:
   chmod +x project_analyze.sh
   chmod +x feature5script
Possible Arguments:
This script gives a prompt to the user asking to pick a feature of the script to use. The user is prompted to pick a feature according to the number they have been designated. Any other input will lead to an error message.

Feature 1

Feature: Find Tag
Description:
This feature will prompt the user to input a tag and then will search through every commented line in every python file and will echo any lines that include the tag in them. It will also put them in a file named Tag.log in the Project01 directory.
Reference:
   Some code was taken from https://unix.stackexchange.com/questions/59893/grep-lines-starting-with-1-in-ubuntu
Execution:
This code will be executed by running the project_analyze.sh script and replying 1 to the prompt
Potential Pitfalls:
Since this file uses grep a potential downfall could be if your tag is the same as the name of a another file or if a commmented file in any file contains the string ".py", they will be included in the result.

Feature 2

Feature: File Size
Description:
This feature will list all the files in the repo and sort them according to their size and also show them in a human-readable format
Reference:
   Some code was taken from https://askubuntu.com/questions/811210/how-can-i-make-ls-only-display-files
Execution:
This code will be executed by running the project_analyze.sh script and replying 2  to the prompt                                                                                                                                                                                                                                                                                       

Feature 3

Feature: File Type Count
Description:
This feature will prompt the user to input an extension and then will search through the directory
Execution:
This code will be executed by running the project_analyze.sh script and replying 3  to the prompt
Potential Pitfalls:
Since this file uses grep a potential downfall could be if your extension is also used as a filename. However, this kind of filenaming is bad naming practice and should not be used in the first place

Feature 4

Feature: Switch to Executable
Description:
This feature will change the permissions of the *.sh files so only groups who have write permissions have executable permissions and no one else. The feature also has an option that allows the user to revert the changes and restore the original permissions
Reference:
Some code was taken from [[https://unix.stackexchange.com/questions/39710/how-to-get-permission-number-by-string-rw-r-r]]
Execution:
This code will be executed by running the project_analyze.sh script and replying 4 to the prompt

Feature 5

Feature: Backup and Restore
Description:
This feature allows two options; Backup and Restore. The backup options will delete all *.tmp files from their original location and move them to a directory named backup. The Restore feature will then restore the files in the backup directory to their original location
Execution: 
This code will be executed by running the project_analyze.sh script and replying 5 to the prompt.
Note:
DO NOT delete feature5script. This feature works by calling feature5script from the main script

Custom Feature 1

Feature: Word Count
Description:
This feature will ask the user for a prompt asking for a filename and then the feature will return a list of the user 20 most used words in that file. The feature also has a list of the 100 most commonly used words in english writing and will eliminate these words from the count.
Reference:
Some code was taken from [[https://unix.stackexchange.com/questions/39710/how-to-get-permission-number-by-string-rw-r-r]]
Execution:
This code will be executed by running the project_analyze.sh script and replying 7 to the prompt.
Note:
DO NOT delete the file named words. This feature removes the most used words from its wordcount using that file. The file testcase is a testcase for this feature

Custom Feature 2

Feature: Deleting Duplicated Files
Description:    
This feature will search through the hashcode for all files and find any that have been duplicated. It will then prompt the user for permission to delete the files that have been unnecessarily duplicated
Execution:
This code will be executed by running the project_analyze.sh script and replying 6 to the prompt

bashscripts's People

Contributors

mujtaa3 avatar

Stargazers

Ahmed Mujtaba avatar

Watchers

Ahmed Mujtaba avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.