I had to generate a txt file for a given range of numbers. As usual I had to use seq range_start range_end > text_file.txt to put it in a txt file. I gave the seq range where the starting point was 01700 and the ending point was 01800. I know it’s useless to have 0 before the number but in my case it was important. The file generated had lines like 1700, 1701 … 1800. But there was no 0 before the numbers as I put in the command. So, based on the situation how am I supposed to put 0 before every line in the txt file? Or is there any way to generate the txt with 0 in it before every line?
>Solution :
Try seq -w to keep consistent output width.
seq -w 01700 01800 will output 01700, 01701 etc.
As always, man seq should be your starting point when wondering about seq. Unix manpages are there for a reason, and very often solve such questions up front.