5

Say I run seq 4000000 4100000, I want seq print the numbers, as quoted from the man page, "from first (default 1), to near last as possible". Just like the GNU seq does.

But the output of my command is

4e+06
4e+06
4e+06
4e+06
4e+06
4.00000e+06
4.00001e+06

I want it to be

4000000
4000001
4000002

etc.

4099999
4100000

I thought that maybe -w could fix it but I am not sure what input to give it, giving it no input makes the output the same.

6

So you want to display the results without scientific notation? Try this:

seq -f "%.0f" 4000000 4100000

So I'm actually changing the format (using -f) into a floating-point format with 0 decimal places (%.0f)

On my Mac this results in:

4000000
4000001
4000002
4000003

etc.

4099997
4099998
4099999
4100000

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.