Bash scripts | Computer Science

Write a script called count.bash that, for each regular file in the working directory, prints the filename, the # of lines, and the # of words to stdout, like this:breadIsDangerous.txt 73 431
spellExample 5 21
Do not use find
Test your script with filenames that have spaces in them. Get it right.
Q 1: Upload count.bash
Write a shell script that accepts two file extensions as command line arguments and renames all files with the first extension within the current working directory to have the second extension instead.For example:
$ reextend .log .txt
Would cause install.log to be renamed to install.txt, and
$ reextend A B
Would cause TADAA to be renamed to TADAB . It would also cause file.A to be renamedfile.B .
The script should print out error messages as is appropriate if there is any problem with the command line arguments. Test the script with a range of different parameters, including incorrect parameters or missing parameters.
hint: See Parameter Expansion in the bash man or info page.
hint: See what ls -1 does.
Q 2: Call this script reextend , and upload it w/your lab.
You just used your favorite ripper to get some songs off a bunch of CDs that you legally purchased. You set the output format, got the bit-rate you wanted, but forgot to set the format for the filenames. You ended up w/listings like this:Led Zeppelin – Over the Hills and Far Away.mp3
, all in the same directory. What you really wanted was to have the songs in directories by artist, and just the song name for the filename:
Led Zeppelin/Over the Hills and Far Away.mp3
So, write a script that looks in the current directory only for mp3 files, breaks the filename out into artist and song title, creates the appropriate directory (if it doesn’t already exist), removes the artist and the first ‘ – ‘ from the filename, and moves it into the directory.
Q 3: Call this script organiseMusic , and upload it w/your lab.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
The price is based on these factors:
Academic level
Number of pages
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Benefits of our college essay writing service

  • 80+ disciplines

    Buy an essay in any subject you find difficult—we’ll have a specialist in it ready

  • 4-hour deadlines

    Ask for help with your most urgent short tasks—we can complete them in 4 hours!

  • Free revision

    Get your paper revised for free if it doesn’t meet your instructions.

  • 24/7 support

    Contact us anytime if you need help with your essay

  • Custom formatting

    APA, MLA, Chicago—we can use any formatting style you need.

  • Plagiarism check

    Get a paper that’s fully original and checked for plagiarism

What the numbers say?

  • 527
    writers active
  • 9.5 out of 10
    current average quality score
  • 98.40%
    of orders delivered on time