Questions tagged [seq]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
4answers
86 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 ...
3
votes
3answers
254 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 ...
5
votes
1answer
366 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 ...
1
vote
3answers
204 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 ...
7
votes
7answers
600 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 ...
5
votes
1answer
400 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 ...
1
vote
1answer
534 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 ...
1
vote
4answers
329 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-...
0
votes
1answer
269 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 ...
0
votes
2answers
396 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 ...
1
vote
3answers
61 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 ...
2
votes
1answer
128 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 ...
3
votes
1answer
273 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 ...
0
votes
2answers
103 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: $...
-3
votes
2answers
358 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?
6
votes
3answers
883 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 ...
2
votes
2answers
1k 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 ...
1
vote
1answer
184 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 ...
6
votes
8answers
964 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 ...
2
votes
2answers
417 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 ...
19
votes
5answers
49k 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 ...
3
votes
3answers
98 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 ...
2
votes
2answers
1k 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 ...
3
votes
2answers
3k views

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

Can I use seq to go from 001 to 999?
5
votes
1answer
332 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 ...
11
votes
5answers
4k 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 ...
32
votes
6answers
28k 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,...
2
votes
1answer
7k 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 ...
3
votes
6answers
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 ...