====== CS 370 List of Projects ====== You will be writing shell scripts for projects. It is suggested that you use the [[https://www.shellcheck.net/|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: [[https://docs.google.com/document/d/1jjqUMPsvNs2szO2YihCR1NQYpDFuFKjQoMJ2yd83D4c/edit?usp=sharing|names2userids.sh]] Option 2: [[https://docs.google.com/document/d/1Y4fIGofLVE8YA_a_oB5f_x9n2ef9BcSfu75XKKG56O8/edit?usp=sharing|fnamefix.sh]] ---- ===== Project 1 - txt2pdf.sh ===== Deadline: Sun, Jun 16, 11:59pm See my project followups on [[https://piazza.com/class/lwd125nsggo6gv/post/18|Piazza Q&A]]. See related class recordings: [[https://www.youtube.com/watch?v=nb46KDtfhYY&t=5535s|Jun 6]], [[https://www.youtube.com/watch?v=HwArVh-zWH0&t=5150s|Jun 10]], [[https://youtu.be/IfamJJ_ZpaE?t=16|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 [[http://plato.monmouth.edu/~jchung/download/fortune.txt|fortune.txt]] file, the resulting PDF file would be named [[http://plato.monmouth.edu/~jchung/download/fortune.txt.pdf|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: [[http://plato.monmouth.edu/~jchung/download/fortune-2pg.txt.pdf|fortune.txt.pdf]]. If the input textfile [[cs370/cs_370_-_shell_scripting?&#filedirectory_tests|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. ==== Links ==== * [[cs370/cs_370_-_command_line_option_handling|shell script commandline argument handling]] ==== 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. ----