1. Not finding help here? Sign up for a free 30min 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!

Help with bash scripting

  1. Jun 14, 2009 #1
    Hello,

    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:

    #!/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 :)
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?



Similar Discussions: Help with bash scripting
  1. Help with solution (Replies: 0)

  2. Matlab help (Replies: 0)

  3. Thermodynamics help (Replies: 0)

Loading...