Yahya Al Hattali
Yahya Al Hattali

Reputation: 11

python os.system got my long command trim into two lines

import os
cmd =str("./xtool -l ./temp_files/"+file1+ " -t "+line+" -json -o "+result_file)
os.system(cmd)

Im trying to run this command with python but the code got trimmed because of long files names so it read up to "+line+" and any things else after read as new command so I got error like this sh: 2: -json: not found

Upvotes: -1

Views: 96

Answers (1)

Yahya Al Hattali
Yahya Al Hattali

Reputation: 11

I got it fixed by adding line.strip()

cmd=f'./tools/nuclei -l {urlsList} -t {line.strip()} -json -o {results}'

Upvotes: 0

Related Questions