GNU seq’s cousin on FreeBSD is… jot

This is another of my placeholders for reference.

I’ve got a FreeBSD system which is lacking some of the tools which I’ve gotten used to having, whether from Linux or Solaris.

I’ll often use the GNU tool seq to iterate through things on the command line… for example, if I’m going to ping 192.168.1.20-40, I might, at my bash prompt,

for i in `seq 20 40`; do ping 192.168.1.${i}; done

Quite handy, though FreeBSD doesn’t have it, and I haven’t installed whatever port contains it.

So… I’ll use jot, now that I’ve once again looked up what it is and how it works.

The equivalent line to that above?

for i in `jot 21 20`; do ping 192.168.1.${i}; done

View Comments

#1 andy on 11.17.08 at 12:30 pm

thank you – that was helpful

#2 Rick on 12.11.08 at 9:53 am

thanks that saved me…

#3 William on 02.22.09 at 5:05 am

Oh, that’s a godsend, especially because I was in the exact opposite boat you were in. Oh, and by the way, install coreutils, then seq should be available as gseq.

#4 “seq” unter Mac OSX – “jot” « Mac OSX & Linux – loggn.de on 10.28.09 at 9:49 am

[...] Links: Manpage “jot” GNU seq’s cousin on FreeBSD is… jot [...]

#5 cactus on 12.04.09 at 12:44 am

Or just use bash.

for i in {1..10}; do echo $x; done

#6 cactus on 12.04.09 at 12:44 am

oops.
Should have been “echo $i”.
;)

#7 Mac on 04.10.10 at 10:28 am

Very helpful, I keep forgetting this command and keep looking up this page since I’ve switched to FreeBSD. Thanks!

Leave a Comment

blog comments powered by Disqus