I need to read input from a file given in following format.
$ ./process_data.sh arg1 < input_data.txt
How do I read
input_data in my shell script
closed as not a real question by jw013, jasonwryan, Renan, warl0ck, Stéphane Gimenez Sep 17 '12 at 19:31
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.
In such usage there are several ways to read it: while construction (will output argument and each string of file input_data.txt)
awk (will output argument and second and third column of file input data)
and so on. You can use sed, cut and many other unix utilities like in examples. Chose of utility depends on how you need to transform input data. Of course you can change examples as you want.
Good luck =)
In your process_data.sh you can write below code