- #1
caelestis
- 12
- 0
Hello,
I was wondering if someone could help me with this question to let me know if I'm on the right track?
We are given two files:
The first is a database file in the format of:
student-id [tab] lab-group [tab] Last-name, Other names
e.g u1234 [tab] tues9-11 [tab] Smith, John
u2345 [tab] wed9-11 [tab] Jones, Fred
The second is a log file in the format of:
student-id [tab] date of submission [tab] filename
e.g u1234 [tab] 15 June 2004 [tab] a2.jar
There is a single tab character between the variables.
It asks us to write a bash script that prints the list of names of students who have *not* submitted any files.
It also needs to take the names of both files as its two command line arguments.
This is what i have at the moment:
#!/bin/bash
echo $1,$2
stuID=$(cat log.txt | cut -f1)
echo "$stuID" > submit
stuList=$(cat database.txt | cut -f1)
echo "$stuList" > late
grep -f submit late
Thankyou, I would kindly appreciate your help :)
I was wondering if someone could help me with this question to let me know if I'm on the right track?
Homework Statement
We are given two files:
The first is a database file in the format of:
student-id [tab] lab-group [tab] Last-name, Other names
e.g u1234 [tab] tues9-11 [tab] Smith, John
u2345 [tab] wed9-11 [tab] Jones, Fred
The second is a log file in the format of:
student-id [tab] date of submission [tab] filename
e.g u1234 [tab] 15 June 2004 [tab] a2.jar
There is a single tab character between the variables.
It asks us to write a bash script that prints the list of names of students who have *not* submitted any files.
It also needs to take the names of both files as its two command line arguments.
The Attempt at a Solution
This is what i have at the moment:
#!/bin/bash
echo $1,$2
stuID=$(cat log.txt | cut -f1)
echo "$stuID" > submit
stuList=$(cat database.txt | cut -f1)
echo "$stuList" > late
grep -f submit late
Thankyou, I would kindly appreciate your help :)