1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Help with bash scripting

  1. Jun 14, 2009 #1

    I was wondering if someone could help me with this question to let me know if i'm on the right track?

    1. The problem statement, all variables and given/known data

    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.

    3. The attempt at a solution

    This is what i have at the moment:


    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 :)
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted