Questions tagged [seq]
Use for questions related to "seq", a command-line tool to print sequences of numbers.
42 questions
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-...
1 vote
1 answer
132 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....
1 vote
1 answer
360 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 ...
-3 votes
1 answer
709 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....
2 votes
1 answer
159 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....
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://...
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 ...
2 votes
2 answers
516 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(...
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 ...
1 vote
3 answers
61 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 ...
0 votes
1 answer
141 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 ...
3 votes
1 answer
294 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/...
-1 votes
2 answers
138 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: ...
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 ...
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 ...