Reputation
2,428
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
7 23 60
Impact
~496k people reached

May
3
revised Access individual lines of a text file and create separate text file with that name
Advertise argparse advantages
May
3
comment Access individual lines of a text file and create separate text file with that name
I think that will break with spaces in the words as well.
May
3
comment Access individual lines of a text file and create separate text file with that name
The problem with those kind of solutions is that somebody will come along with a file that does contain spaces and then it breaks in a non-obvious way. That is what I do not want to have in my software.
May
2
comment Access individual lines of a text file and create separate text file with that name
You can use for item, content in zip(lines(sys.argv[1]), lines(sys.argv[2])) and have this even shorter. It won't matter in a short script like this, but that would leak file descriptors when you use open () without a context manager (with open() as f:).
May
1
revised Access individual lines of a text file and create separate text file with that name
Add spaces
May
1
comment Access individual lines of a text file and create separate text file with that name
I see, so the $(…) is needed. But that adds another complication layer about the spaces in the file. I have no idea how to quote that properly. How come you have the most upvotes with a program that cannot cope with spaces‽
May
1
comment Access individual lines of a text file and create separate text file with that name
If you seriously want to use Bash, be sure to read the list of pitfalls. If you think there are to many pitfalls, don't use Bash ;-).
May
1
revised Access individual lines of a text file and create separate text file with that name
Add wget for download
May
1
comment Access individual lines of a text file and create separate text file with that name
Indeed, it will put all the words of both files into the same line. It will then use the first word as the name of the file and the second word as the content. This means that if text1.txt contains two words or more, everything of text2.txt is ignored. – And why did you wrap it in $(…)?
May
1
revised Access individual lines of a text file and create separate text file with that name
Use an unordered list.
May
1
reviewed Approve Reduced battery life with ubuntu 15.04
May
1
reviewed Approve How to install Visual Studio Code on Ubuntu?
May
1
revised Access individual lines of a text file and create separate text file with that name
added 53 characters in body
May
1
comment Access individual lines of a text file and create separate text file with that name
You need $1 instead of #1 for the first command line argument. And text2 seems to be fixed, why not use $2.
May
1
comment Access individual lines of a text file and create separate text file with that name
You mean since paste used tab as a delimiter?
May
1
comment Access individual lines of a text file and create separate text file with that name
That will break once f contains a space. You need to use quotes there: "$f.txt".
May
1
awarded  Custodian
May
1
reviewed Approve Access individual lines of a text file and create separate text file with that name
May
1
answered Access individual lines of a text file and create separate text file with that name
Apr
24
revised Upgrade to Kubuntu 15.04 broke settings and Akonadi
Explain change of backend