Comments on Linux seq Command Tutorial for Beginners (5 Examples)

Sometimes, you come across a command line tool that offers limited functionality on its own, but when used with other tools, you realize its actual potential. Once such tool is seq, which prints a sequence of numbers.

3 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: thecursedfly

Small mistake I guess:

"Suppose you want to perform addition of some numbers, say from 1 to 10." should be "from 111 to 121".

By: guest

seq -s " + " 111 121

in my shell creates "111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 +"

and "expr" will then complain (syntax error) for the last +

A possible fix is    seq -s " + " -t 0 111 121

By: Holgi

you could even use both -format and --separator in one command:

seq -f "'%g'" -s "," 90 111

'90','91','92','93','94','95','96','97','98','99','100','101','102','103','104','105','106','107','108','109','110','111'