<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://cs.indstate.edu/web/index.php?action=history&amp;feed=atom&amp;title=Scripting</id>
	<title>Scripting - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://cs.indstate.edu/web/index.php?action=history&amp;feed=atom&amp;title=Scripting"/>
	<link rel="alternate" type="text/html" href="https://cs.indstate.edu/web/index.php?title=Scripting&amp;action=history"/>
	<updated>2026-04-14T19:28:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://cs.indstate.edu/web/index.php?title=Scripting&amp;diff=389&amp;oldid=prev</id>
		<title>Jkinne: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://cs.indstate.edu/web/index.php?title=Scripting&amp;diff=389&amp;oldid=prev"/>
		<updated>2025-08-17T13:22:22Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:22, 17 August 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wiki2:diff:1.41:old-388:rev-389 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jkinne</name></author>
	</entry>
	<entry>
		<id>https://cs.indstate.edu/web/index.php?title=Scripting&amp;diff=388&amp;oldid=prev</id>
		<title>wiki_previous&gt;Jkinne: /* Python */</title>
		<link rel="alternate" type="text/html" href="https://cs.indstate.edu/web/index.php?title=Scripting&amp;diff=388&amp;oldid=prev"/>
		<updated>2024-03-08T16:16:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Python&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A few example scripts. Most people will use bash, tcsh, or zsh for their scripting language. But you could also use python, perl, javascript, C, or whatever language you want. The shell languages are normally less typing, so it is worth getting used to one of them.&lt;br /&gt;
&lt;br /&gt;
Here is an example shell script in bash to hand in a C programming assignment using the handin submission system that some CS faculty use.&lt;br /&gt;
&lt;br /&gt;
=Bash=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash                                                                                                                                     &lt;br /&gt;
&lt;br /&gt;
if [ $# -lt 1 ]; then&lt;br /&gt;
    echo &amp;quot;Usage: ./handin_check.sh assignment [course]&amp;quot;&lt;br /&gt;
    echo &amp;quot;  This program will compile the assignment, hand it in, and run hwcheck.&amp;quot;&lt;br /&gt;
    echo &amp;quot;  If course is not given, then default is the course you are logged into.&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
assignment=&amp;quot;$1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
cd ~/$assignment&lt;br /&gt;
make&lt;br /&gt;
&lt;br /&gt;
if [ $# -gt 1 ]; then&lt;br /&gt;
    course=$2&lt;br /&gt;
    submit --course &amp;quot;$course&amp;quot;&lt;br /&gt;
    submit --hwcheck --course &amp;quot;$course&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
    submit&lt;br /&gt;
    submit --hwcheck&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that to make this file easily executable, you will want to chmod to make it executable by yourself. If the file is named handin_check.sh you could do: &amp;lt;code&amp;gt;chmod u+x handin_check.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This could be improved by checking the result of make to confirm that the project was successfully compiled, and similarly for changing directory and submitting the assignment. If you plan to use bash, zsh, tcsh, or one of the other shell languages, it would be good to go through a tutorial to get familiar with the syntax of the language. They are a bit different than standard programming languages.&lt;br /&gt;
&lt;br /&gt;
= Python =&lt;br /&gt;
Here is a python script to do the same thing. If the file were named handin_check.py, then you would do this to make it executable: &amp;lt;code&amp;gt;chmod u+x handin_check.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/env python3                                                                                                                              &lt;br /&gt;
&lt;br /&gt;
import sys, os, subprocess&lt;br /&gt;
&lt;br /&gt;
if len(sys.argv) &amp;lt; 1:&lt;br /&gt;
    print( &amp;quot;Usage: ./handin_check.sh assignment [course]&amp;quot;)&lt;br /&gt;
    print(&amp;quot;  This program will compile the assignment, hand it in, and run hwcheck.&amp;quot;)&lt;br /&gt;
    print(&amp;quot;  If course is not given, then default is the course you are logged into.&amp;quot;)&lt;br /&gt;
    sys.exit()&lt;br /&gt;
&lt;br /&gt;
assignment = sys.argv[1]&lt;br /&gt;
&lt;br /&gt;
#os.chdir(f&amp;quot;~/{assignment}&amp;quot;)&lt;br /&gt;
os.chdir(f&amp;quot;/u1/class/MYUSERNAME/{assignment}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if len(sys.argv) &amp;gt; 2:&lt;br /&gt;
    course = sys.argv[2]&lt;br /&gt;
    subprocess.run(f&amp;#039;submit --course {course}&amp;#039;, shell=True)&lt;br /&gt;
    subprocess.run(f&amp;#039;submit --hwcheck --course {course}&amp;#039;, shell=True)&lt;br /&gt;
else:&lt;br /&gt;
    subprocess.run(&amp;#039;submit&amp;#039;, shell=True)&lt;br /&gt;
    subprocess.run(&amp;#039;submit --hwcheck&amp;#039;, shell=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>wiki_previous&gt;Jkinne</name></author>
	</entry>
</feed>