浏览代码

added scripts to run files for ease of use

tarfeef101 6 年之前
父节点
当前提交
548cc9255c
共有 2 个文件被更改,包括 40 次插入0 次删除
  1. 20 0
      a2/receiver.sh
  2. 20 0
      a2/sender.sh

+ 20 - 0
a2/receiver.sh

@@ -0,0 +1,20 @@
+#!/bin/bash
+
+#Run script for receiver as part of
+#Assignment 2
+#Computer Networks (CS 456)
+#Number of parameters: 4
+#Parameter:
+#    $1: <host_address>
+#    $2: <receiving_port_on_host>
+#    $3: <receiveing_port_on_receiver>
+#    $4: file_to_be_saved
+
+#For Python implementation
+if [ "$#" -ne 4 ];
+then
+  echo "Program takes 4 parameters, which are a host address, host port, receiver's port, and filename to be saved"
+  exit 1
+fi
+
+python3 receiver.py $1 $2 $3 $4

+ 20 - 0
a2/sender.sh

@@ -0,0 +1,20 @@
+#!/bin/bash
+
+#Run script for sender as part of
+#Assignment 2
+#Computer Networks (CS 456)
+#Number of parameters: 4
+#Parameter:
+#    $1: <host_address>
+#    $2: <receiving_port_on_host>
+#    $3: <receiveing_port_on_sender>
+#    $4: file_to_be_transmitted
+
+#For Python implementation
+if [ "$#" -ne 4 ];
+then
+  echo "Program takes 4 parameters, which are a host address, host port, sender's port, and filename to be sent"
+  exit 1
+fi
+
+python3 sender.py $1 $2 $3 $4