Results 1 to 10 of 13

Thread: Bash script sequencing

Threaded View

  1. #1
    Join Date
    Nov 2016

    Bash script sequencing

    In my shell environment:
    GNU bash, version 5.0.16(1)-release (x86_64-pc-linux-gnu)

    echo {1..10}
    1 2 3 4 5 6 7 8 9 10
    echo {a..f}
    a b c d e f

    The problem is in making that work as a for loop sequence

    #! /bin/bash
    for i in {1..10}; do
    echo $i

    output from script:

    for i in {a..f}; do
    echo $i

    output from script:

    I can get the numeric part to work using an outside function, $(seq 1 10), but that solution probably isn't as efficient, and isn't doing anything to help me sequence alphabetical characters inside a for loop.
    Last edited by yegnal; June 2nd, 2020 at 12:46 PM.

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts