calling awk from bash function not working

Discussion in 'Shell Script' started by spowel4, Aug 28, 2010.

  1. spowel4

    spowel4 New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    If I have the following line in a bash script, it works fine:
    CoDescDate=$(awk -F"\t" '{print $22}' $1)
    If I embed the above line in a function that is within the same bash script, the script seems to hang at the point of invoking the function.

    pay_ending_date () {
    CoDescDate=$(awk -F"\t" '{print $22}' $1)
    }
    How I'm calling the function:
    pay_ending_date
    I don't understand why it works when run directly from the script but doesn't work when embedded inside a function?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice