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?

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by spowel4
0

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?

The call is missing the parameter

pay_ending_date $1

or

pay_ending_date "filename"
0

oh my god, I feel like an idiot! Thanks for the help, that seems to have fixed it!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.