Find the answer to your Linux question:
Results 1 to 4 of 4
This is rather foolish but kind of helpful. Does anyone know of command that will display A-Z out on separte lines, for instance the seq command works like this with ...
  1. #1
    Just Joined!
    Join Date
    Feb 2007
    Posts
    3

    command that displays alphabet

    This is rather foolish but kind of helpful. Does anyone know of command that will display A-Z out on separte lines, for instance the seq command works like this with numbers. seq 0 9 will display 0 thru 9 on seprate lines. Does anyone know how to do this using letters. Thanks

  2. #2
    Just Joined!
    Join Date
    Feb 2007
    Location
    Winnipeg, MB
    Posts
    14
    I don't know if there's a way to do this in Linux already, but here's a simple program for you:

    #include <iostream>

    using namespace std;

    int main(void)
    {
    for (char letter = 'A'; letter <= 'Z'; letter++)
    cout << letter << endl;
    }//main

    1) Save it as az.cpp

    2) g++ az.cpp -o az

    2.5) If g++ command not found:
    su -c 'apt-get update'
    su -c 'apt-get install g++'

    3) This produces the executable az. Run it with
    ./az

    -Hope this helps,
    Dave

  3. #3
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    452
    welcome to the forum

    you could use the shell, like this:

    for i in A B C ... X Y Z
    do
    echo $i
    done
    the sun is new every day (heraclitus)

  4. #4
    Just Joined!
    Join Date
    Feb 2007
    Posts
    3

    thanks guys

    yeah thanks guys i was just looking for a specific command. i will just write it out. I was writing a program that was going to do some character replacement. It would have been nice to just have a seq command for characters that would have been lovely versus typing out A B C D E F G and so on then lower case but oh well. I will get it done. thanks dudes.

Posting Permissions

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