Complete the following shell scripts:

  1. Any scripts we start in class.

  2. Version 2 of dirinfo.

  3. Write a shell script called triangle that prints a triangle to the screen.
  4. Write a script called uncapFile that will convert any capital letters in a file name to lower-case letters. Hint: use the tr and mv commands. You will need some quoting too. Just try the tr command to start.

  5. Write a script called copyUSB that copies or moves files from your current directory to your USB drive.

  6. Write a script called squeezeSpaces that will process input from the keyboard (stdin), squeeze out all the spaces and replace them with a single pipe character, and show the results to the screen (stdout).

  7. Write a script called unzipAll that will unzip every .zip file in the current directory, and if the file is unzipped, move it into a backup directory.

  8. Create a script called makedos by copying the code.
  9. Create a script called undos by copying the code.
  10. Write a shell script called untab1 that will take a file name as an argument and convert the tabs to pipes. Have this script write the output to stdout. Use the tr command
  11. Write a shell script called untab2 that will take a file name as an argument and convert the tabs to pipes. Have this script write the output to stdout. Use the sed command.
  12. Write a shell script called untab that will take multiple filenames and for each, convert the tabs to commas.

    To do this, write a function that converts one file and shows the output on the screen. Call the function untab. The file to convert should be an argument to the function. Have this script write its output to a new file in the current directory with the same name, but that ends with a .csv extension.

    After you have it working for a single file (using the function), updated it to work for all file arguments passed to the script.

    You may choose to use tr or sed, whichever you prefer.

    For more fun, have the script take the character to change the tab to as the first argument (and default to a ,).

More fun!