Results 1 to 4 of 4

Thread: Bash Script - awk

  1. #1
    Join Date
    Oct 2011
    Beans
    2

    Bash Script - awk

    Hi!
    Im a first year student at a university of applied sciences and im currently enrolled in a course that teaches the basics of using ubuntu.
    We have now started bash scripting and i am totally lost on my latest assignment.

    Basically im supposed to make a script that reads a .txt file and creates a group,adds all of the users in the file and places them into the group i just made "grupp".
    Ive struggled with the awk command and for loops but i havent gotten anywhere close to being right. So i am hoping some of you could help me?

    Heres the text from the file:

    Jonny Karlsson,karlssoj,larare
    Sven Svensson,svenssoj,student
    Lisa Lisasson,lisassoj,student
    Mia Miasson,miassoj,larare
    Sune Sunesson,sunessoj,student

  2. #2
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Bash Script - awk

    Some hints. You'll want the field separator to be a comma and you might find the awk function 'system' useful.

  3. #3
    Join Date
    Oct 2011
    Beans
    2

    Re: Bash Script - awk

    Quote Originally Posted by Lars Noodén View Post
    Some hints. You'll want the field separator to be a comma and you might find the awk function 'system' useful.
    Yea,i know that but i couldnt get it to work. :/

  4. #4
    Join Date
    Jul 2007
    Location
    Poland
    Beans
    4,499
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Bash Script - awk

    so post your code and someone will point out what you did wrong

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •