I have written a bash script which calls another script by passing it an argument. The argument in this case is a file that contains a few lines.
I do something like this:
#! /bin/bash
`python script.py -i input.txt /path/to/somefile`
now, input.txt contains lines like:
something 1
something 2
something 3
The problem here is that each line of input.txt is evaluated as a program itself by the bash script instead of being passed as it is to the script.py program.
so, script.py program expects a file with 3 lines as input as shown above but instead receives some other input (result of evaluating something 1, something 2 and so on).
how can I pass this file as an argument to script.py?
if I invoke script.py outside the bash script like this:
python script.py -i input.txt /path/to/somefile
it works good. script.py reads one line from input.txt at a time and operates on it.