Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8906769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:44:22+00:00 2026-06-15T02:44:22+00:00

I use seq a lot in my simulation shell scripts. The Git bash does

  • 0

I use seq a lot in my simulation shell scripts. The Git bash does not provide it, thus I am looking for an alternative.

Is there an alternative to seq that is part of the commands supported by the Git bash?

Current Solution: Based on Ignacio’s answer I wrote a little helper script that provides my legacy scripts with a simple seq function. I also noticed, when using echo {1..10} with variables, you need to use eval to get the sequence output instead of the unexpanded expression:

a=0; b=5
eval echo {$a..$b}  # outputs 0 1 2 4 5
echo {$a..$b}       # outputs {0..5}

Here is my new seq.sh:

#!/bin/bash
# check for the real seq and export a new seq if not found
# import this script via `source ./seq.sh`
#
hasSeq(){
  which seq >/devnull 2>&1
}

mySeq(){
    case $# in
        1) eval echo {1..$1};;
        2) eval echo {$1..$2};;
        3) echo "seq(3) not supported" 1>&2;;
    esac
}

if ! hasSeq; then
    seq(){
        mySeq $*
    }
fi

hasSeq || export -f seq
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:44:23+00:00Added an answer on June 15, 2026 at 2:44 am

    Assuming the version of bash is recent enough, you could use brace expansion.

    $ echo {1..16}
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
    

    Or… you know…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use Seq.cache with a function that I made that returns a
use messagepack on android, the can serialize/deserialize a class, but not absolutely right .
I was trying to use Seq.first today, and the compiler says it has been
When I paste this code into a REPL, it works fine: (use 'clojure.contrib.seq-utils) (defn-
I'm trying to use create a Clojure seq from some iterative Java library code
If I have an infinite sequence, I cannot use a normal Seq.tryFind . However,
I'm trying to use the Seq.generate_using function but unfortunately, I don't seem to be
Using the wildcard pattern with use works within a sequence expression, but not otherwise.
I would like to make use @IndexColumn to set seq number of some data
I keep wondering why did facebook use like submit from button and not just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.