I am calling a python script, parse_input.pyfrom bash
parse_input.pyaccepts a command line argument that has many '\n'characters.
Input Example:
$ python parse_input.py "1\n2\n"
import sys
import pdb
if __name__ == "__main__":
assert(len(sys.argv) == 2)
data = sys.argv[1]
pdb.set_trace()
print data
I can see on pdb that `data = "1\\n2\\n", then how I wantdata="1\n2\n"
I saw similar behavior only with \(without \n) which is replaced by\\
How to remove an extra \?
I do not want the script to deal with additional \as the same input can also be obtained from the file.
bash version : GNU bash version 4.2.24 (1) -release (i686-pc-linux-gnu)
python version : 2.7.3
source
share