Questions tagged [seq]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
18 views

Why when using seq -s delimiter is after the last element?

I was trying different examples from Unix shell tutorial with seq command and got a different result in my terminal. command: seq -s '/' 1 5 result: 1/2/3/4/5/ instead of 1/2/3/4/5 The command ...
user avatar
-3 votes
1 answer
109 views

2 decimal increment in seq makes everything with 2 decimal

I want to use this command in bash: datarange=$(seq 0.5 0.25 5.5) with output echo $datarange = 0.50 0.75 1.00 1.25 1.50 1.75 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00 5.25 5....
user avatar
  • 1
2 votes
1 answer
93 views

Using "seq", If one column is equal to 5, continue the other column

For example, I want to start from the far right column, and once that reaches 5, continue the count from the second farthest column. 0.0.0.0 0.0.0.1 0.0.0.2 0.0.0.3 0.0.0.4 0.0.0.5 0.0.1.5 0.0.2.5 0.0....
user avatar
-1 votes
2 answers
1k views

how to use seq with xargs to curl request [closed]

I'm working on curl commmand that performs an action based upon parms value curl 'http://www.example.com/actionid?id=123' id value i want to pump dynamically so seq 1 10 | xargs -I + curl 'http://...
user avatar
1 vote
1 answer
528 views

How do I iterate through multiple bash arrays and elements that are not previously stored as variables?

Problem I'm trying to Solve The problem I am trying to solve is being able to iterate through elements in two bash arrays as well as individual elements such that these elements are not stored ...
user avatar
2 votes
2 answers
160 views

multiple sequences in a single variable

I have two type ranges which I need to get it in a single variable. How can I do that? eg: I have one range like bs0401 to bs0405 (bs0401,bs0402,bs0403...) and another range like bn0201 to bn0205(...
user avatar
  • 37
0 votes
6 answers
914 views

Faster way to enumerate number than GNU seq? [closed]

I want to enumerate numbers (between 1 to 10136 range) but so far, most tools and trick I tried would struggle after 109 numbers or so... Here some examples (with smaller range): For seq 99999 real ...
user avatar
1 vote
3 answers
18 views

Monitor how far the SEQuence has got

I have the following script which has been running for over 3 days: seq -w 1 1000000 | while read i; do (./myscript.pl $i >> output.txt); done Is it possible to find out how far it has got with ...
user avatar
  • 2,501
0 votes
1 answer
68 views

Write all numbers between 0 and large number (both inclusive) to a file in random order

For simulation I am trying to do, I want a text file with numbers ranging from 0 to 2^33 which is a huge number. I have used this command: seq 0 Number >> OUTPUT FILE But this is very slow. ...
user avatar
  • 101
2 votes
1 answer
75 views

Search directories containing numbers larger than a certain threshold in their name

This is the command that I have and would like to modify with an additional condition: find /home/user/backups/ -mindepth 2 -maxdepth 3 -name "*~EEEE000.tif" -print This is the output of ls /home/...
user avatar
  • 183
-1 votes
2 answers
91 views

Creating a sequence with _ in the number

Hey I feel like I am probably being a little stupid but I cannot seem to find anywhere how to utilize a sequence with symbol in it. I want to be able to run a sequence from two date and times: ...
user avatar
  • 1
1 vote
4 answers
407 views

Is there an alphabetic equivalent of nl or seq?

I have a file where I'd like to number the lines using "the alphabet" (simple ascii a, b, c, etc.) instead of numbers. So where I could do: nl somefile I'd like to do something like: abc somefile ...
user avatar
  • 123
3 votes
3 answers
753 views

Bash function: Execute $@ command with each argument in sequence executed separately

This is an example function: function example { echo "TextBefore $@ TextAfter" ; } This is the command using the function: example A{1..5}B The output: TextBefore A1B A2B A3B A4B A5B TextAfter ...
user avatar
  • 1,608
6 votes
1 answer
3k views

seq decimal separator

Using a seq command with floating point numbers, my output comes with commas instead of dots as decimal separators, despite using dots in the input: seq 0.1 0.3 1.3 0,1 0,4 0,7 1,0 1,3 I assumed ...
user avatar
  • 10.6k
1 vote
3 answers
815 views

How do I generate a sequence of numbers like this?

I am trying to generate a sequence of numbers where it adds 1 every other time, and 39999 every other time. Example of list which does what I want up to a million: 1 40000 40001 80000 80001 120000 ...
user avatar
  • 23
7 votes
7 answers
2k views

How to avoid printing a newline when seq completes?

To create a column header, looking like: 1234567890123456789 I (am trying to) use seq and echo: seq -s '' 1 9 ; echo -n 0; seq -s '' 1 9 However, seq outputs a newline after each run. How can I ...
user avatar
  • 645
5 votes
1 answer
831 views

nesting brace expansion and command substitution

I want to create a simple bash-script that checks whether a directory contains all the files whose names contain numbers from 1 to N. # Creating some files for testing $ cd /tmp/ $ mkdir test $ touch ...
user avatar
  • 1,151
2 votes
2 answers
3k views

Execute as fast as possible many curl commands

I am gathering some data locally at home on a Raspberry Pi and I want to send the data as fast as possible to a REST API (which I own) on a server on the web. The locally gathered data could flow as ...
user avatar
2 votes
4 answers
1k views

I need to create a loop in bash to join images vertically and ouput multiple joined Pages for print

I am running Ubuntu 18.04. I have a directory full of storyboard images in .jpg format as below. image-0000.jpg image-0001.jpg image-0002.jpg image-0003.jpg image-0004.jpg . . image-3898.jpg image-...
user avatar
0 votes
1 answer
518 views

Using seq and math to manipulate the last octet in an ip address to create a file

Ubuntu 16.04 GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu) We have to add ips to servers a few times a day. I find myself creating different variations of the same file according to the ...
user avatar
0 votes
2 answers
1k views

mkdir with seq command problem

I need to make 5 directories (name1, name2, name3, name4, name5) by command line using mkdir and seq. If I use: mkdir name{`seq -s , 1 5`} It results in one directory: name{1,2,3,4,5} What ...
user avatar
  • 11
1 vote
3 answers
99 views

Unix: Print extra column of values to file

I have a .txt file (new_file.txt) with a column of values (200). I need to print another column beside it, with values 0,1/200,2/200.....1. How should I do this? I am new to this, so any suggestions ...
user avatar
2 votes
1 answer
227 views

Using BSD jot for generating file with random content

Quote from Using BSD jot Most every Linux system comes with GNU seq (a utility to generate sequences of numbers or characters). However, a much older utility – and more flexible one – is the ...
user avatar
  • 1,457
6 votes
1 answer
747 views

How do I make BSD seq not output + and e when using large numbers?

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 ...
user avatar
  • 10.6k
0 votes
2 answers
114 views

echo same string 85 times with some ascending numbers within it

I have to create a huge file of 85 entries in the following format: user_dept1=$( while read -r x && read -r y <&3; do echo " model: $model_1 user: $x department: $y License_Used: $...
user avatar
-3 votes
3 answers
616 views

how to create 2 columns with repeated sequence of values in linux?

I want to create a 2 columns like: 1 10 1 20 1 30 1 40 1 50 2 10 2 20 2 30 2 40 2 50 3 10 3 20 3 30 3 40 3 50 any suggestion please?
user avatar
  • 1,263
12 votes
4 answers
2k views

Portable POSIX shell alternative to GNU seq(1)?

I've noticed you can't really count on seq(1) being available on anything but GNU systems. What's a simple reimplementation of seq(1) I can bring with me written in POSIX (not bash) shell? EDIT: Note ...
user avatar
  • 766
2 votes
2 answers
2k views

Listing numbered files using wildcard sequence with predefined range

I have a folder of numbered data files. I am trying to incrementally extract a predefined range of files. The range of files that I am looking for is predefined in two variables, ns and ne, which ...
user avatar
1 vote
1 answer
205 views

Seq performance hit when specifying a format string

Running seq (GNU coreutils 8.21) without specifying a format string runs extremely quickly compared with any possible format I tried: $ time seq 1e8 > /dev/null seq 1e8 > /dev/null 0.68s ...
user avatar
  • 700
7 votes
8 answers
2k views

Generate two sequences of numbers separated by "|"

I'm using bash (CentOS 5) and looking to generate this output (I assume I could use seq or echo together maybe?): 1|1, 2|2, 3|3, .... 31|31, 32|32, 33|33, I googled seq examples for over two hours ...
user avatar
2 votes
2 answers
560 views

seq -w equivalent in os-x bash

I have sub-folders named 00 01 02, ... n with each foldername containing at least 2 digits. I need to access these sub-folders in os-x terminal. The command for i in $(seq -w 00 06); do echo $i; done ...
user avatar
30 votes
5 answers
89k views

Bash - Sequence of numbers in the same line

I know the command seq to generate sequence of integers, one per line, but I would like to ask two questions: Is it possible to write the numbers of the sequence in the same line? Is it possible to ...
user avatar
  • 401
3 votes
3 answers
111 views

printing a series of characters

My ultimate goal here is to generate a block of text that can be used to test out various fonts at a terminal. I want to generate the file as basically an ascii chart. A series of characters from 1 ...
user avatar
  • 133
2 votes
2 answers
2k views

How can I copy and move a sequential subset of files?

I have a directory containing 1772 files named PRC0001, PRC002,... up to PRC1772. How can I copy a subset, for example PRC0257 to PRC1516 to a different directory? I am trying to do this for several ...
user avatar
3 votes
2 answers
5k views

Can I use seq to go from 001 to 999? [duplicate]

Can I use seq to go from 001 to 999?
user avatar
  • 141
5 votes
2 answers
500 views

`seq` and bash brace expansion failing

IINM my system is failing when bashing for i in {0..10000000}; # Seven zeroes. do false; done # `bash` exited and its `tmux` pane/window was closed. or for i in $(seq 0 10000000); # Seven ...
user avatar
  • 87
12 votes
5 answers
7k views

How to randomize the output from seq?

I know I can use seq to generate a random list of numbers: 1, 2, 3, 4... I want to get those numbers into a random order like 3, 1, 4, 2... I know I can use shuf to shuffle the lines of a file. So I ...
user avatar
  • 5,985
49 votes
6 answers
39k views

How to display numbers in reverse order using seq(1)?

I have iterate over numbers in various order. I am able to display them in increasing order, even with steps like: $ seq --separator="," 1 10 1,2,3,4,5,6,7,8,9,10 $ seq --separator="," 1 2 10 1,3,5,7,...
user avatar
  • 24.1k
2 votes
1 answer
12k views

seq - invalid floating point argument error

I have a file with many numbers, with each number on one line. My goal is to find the numbers that are missing. I'm trying to generate the sequence of all the numbers with seq start=$(head -1 ...
user avatar
  • 932
3 votes
6 answers
2k views

Add consecutive numbers succintly and elegantly to index lines

I usually do this $ wc questions 33 36 3105 questions $ seq 1 33 > nums $ paste nums questions 1 Content 2 ... . . 33 End Content but I feel there could be faster way to do ...
user avatar