Results 1 to 6 of 6

Thread: How to create a list 1mississipi, 2mississipi ... all the way to 100mississipi?

  1. #1
    Join Date
    Apr 2010
    Beans
    Hidden!

    Question How to create a list 1mississipi, 2mississipi ... all the way to 100mississipi?

    I want to create a list like this:

    1mississipi
    2mississipi
    .
    .
    .
    all the way to
    100mississipi


    how can I create a regular text file containing all these, without having to type each manually?

  2. #2
    Join Date
    Dec 2007
    Location
    /home
    Beans
    483

    Re: How to create a list 1mississipi, 2mississipi ... all the way to 100mississipi?

    This is one way to do it.

    Code:
    #!/bin/bash
    
    for x in {1..100}
    do
    echo $x "mississipi"
    done
    btw to save to text you can pipe the output to a text file (./somescript.sh > file.txt)
    Don't eff with The Cult...

  3. #3
    Join Date
    Apr 2010
    Beans
    Hidden!

    Re: How to create a list 1mississipi, 2mississipi ... all the way to 100mississipi?

    thank you, Angry Johnnie.

  4. #4
    Join Date
    Apr 2010
    Beans
    Hidden!

    Re: How to create a list 1mississipi, 2mississipi ... all the way to 100mississipi?

    How do I add the "pipe the output" part?

  5. #5
    Join Date
    Apr 2005
    Location
    My dreams
    Beans
    3,558
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: How to create a list 1mississipi, 2mississipi ... all the way to 100mississipi?

    Quote Originally Posted by bananaboatcoat View Post
    How do I add the "pipe the output" part?
    Save the code as a text file, e.g. mississipi.sh, right-click on it, click Properties, then Permissions and make it executable.

    Then cd in the folder and give:
    Code:
    ./mississipi.sh > myoutput.txt

  6. #6
    Join Date
    Apr 2010
    Beans
    Hidden!

    Re: How to create a list 1mississipi, 2mississipi ... all the way to 100mississipi?

    thank you, kostkon.

Bookmarks

Posting Permissions

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