User Tools

Site Tools


cs370:cs_370_projects

CS 370 List of Projects

You will be writing shell scripts for projects. It is suggested that you use the shellcheck command to check your shell script syntax and style. The shellcheck command is installed on all Linux lab machines and Linux servers.


Project 2

Deadline: Mon, Jul 1, 11:59pm

You will present the project to me in class on Mon, Jul 1.

You have the following project options:

Option 1: names2userids.sh

Option 2: fnamefix.sh


Project 1 - txt2pdf.sh

Deadline: Sun, Jun 16, 11:59pm

See my project followups on Piazza Q&A.

See related class recordings: Jun 6, Jun 10, Jun 11

In groups of two at most, create a simple shell script called txt2pdf.sh that, when called with the name of a text file, converts the text file to PDF. An example usage would be

    txt2pdf.sh textfile.txt

which would create the file textfile.txt.pdf. For the example fortune.txt file, the resulting PDF file would be named fortune.txt.pdf.

The txt2pdf.sh script will also be able create a PDF with 2 pages of text per sheet using the -2 option. The example usage for 2-pages-per-sheet mode would be

    txt2pdf.sh -2 textfile.txt

and the resulting PDF file must look like the following: fortune.txt.pdf.

If the input textfile does not exist, the script must exit with an error message: “Input file not found.”

If the output pdf file already exists, prompt the user to confirm overwrite, else quit.

The script will require the use of three programs in a pipeline (paps or enscript, psnup and ps2pdf).

  • If using paps use its --paper=letter paper size command line option.

The script must include the use of a -h option to display a synopsis, explanation of script options and example script usages.

The final script code must include comments to explain, in detail, what each part of the script does.

Include your group member names and student IDs in a script comment.

How to turn in

Decide on a final version of your group's txt2pdf.sh script. Each person in the group needs to create a ~/cs370/projects/1-txt2pdf or ~/se370/projects/1-txt2pdf directory and then copy the txt2pdf.sh script and any input text files to that directory. Group member names and IDs must be in the txt2pdf.sh script in comments.

Run the submit.cs370 or submit.se370 command.

Don't forget to shellcheck your script.


cs370/cs_370_projects.txt · Last modified: 2024/07/07 07:06 by jchung

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki