Skip to main content

Questions tagged [seq]

Use for questions related to "seq", a command-line tool to print sequences of numbers.

15 votes
2 answers
2k views

Why does "seq 1000000 | tee /dev/stdout" produce more single-digit numbers than expected?

I'm in Linux and in Bash. I expect seq 1000000 | tee /dev/stdout to always output 9 numbers from 1 to 9 and their duplicates (18 in total). But when I do seq 1000000 | tee /dev/stdout | grep -c '^[1-...
decision-making-mike's user avatar
1 vote
1 answer
129 views

sed with seq command problem

With this bash script seq=$(seq 3) sed -i "i ${seq}" input.txt I get: sed: -e expression #1, char 6: unknown command: ` ' But the following script works. sed -i "i 1 2 3" input....
Tokubara's user avatar
  • 113
1 vote
1 answer
346 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 ...
MTabaka's user avatar
  • 11
-3 votes
1 answer
685 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....
PARCB's user avatar
  • 1
2 votes
1 answer
143 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....
curiousJoe's user avatar
1 vote
2 answers
4k 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://...
user316389's user avatar
1 vote
1 answer
1k 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 ...
jamescranston's user avatar
2 votes
2 answers
501 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(...
ARthur's user avatar
  • 37
1 vote
6 answers
1k 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 ...
secemp9's user avatar
  • 2,502
1 vote
3 answers
53 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 ...
oshirowanen's user avatar
  • 2,661
0 votes
1 answer
127 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. The ...
Uday's user avatar
  • 101
3 votes
1 answer
276 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/...
paropunam's user avatar
  • 267
-1 votes
2 answers
122 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: ...
Sulli's user avatar
  • 1
4 votes
4 answers
2k 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 ...
Mike's user avatar
  • 153
3 votes
3 answers
1k 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 How ...
neverMind9's user avatar
  • 1,720

15 30 50 per page