Issue
Suppose we want to write a text file containing
user001 user002 user003 .... user999
Is there any smart way to build it instead of writing a program? Of course it would be easy by writing a C program or an awk script.
I am trying to find some automatic way in vi/vim or in a shell to add lines containing a constant text pattern and the updated value of a counter.
Solution
for counter in {001..999}; do echo "user${counter}" >> outputfile; done
For vim, there's a good answer here: https://vi.stackexchange.com/a/5600
Answered By - micromoses Answer Checked By - Timothy Miller (WPSolving Admin)