Unix/Linux

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Display a block of lines?

    3 answers - 161 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi. In a Bourne script, is there a way to display a block of lines
    without having to "echo" each individual line?
    Thanks!
    Ken
  • No.1 | | 432 bytes | |

    kk_oop@yahoo.com wrote:
    Hi. In a Bourne script, is there a way to display a block of lines
    without having to "echo" each individual line?

    Is this what you're looking for?

    cat << ET
    Hi, these are a
    bunch of lines
    which will get displayed
    all at once.
    ET

    you could do this:

    echo "These are
    some more lines which
    will display separately but can
    be entered at once."
  • No.2 | | 590 bytes | |

    kk_oop@yahoo.com wrote:
    Hi. In a Bourne script, is there a way to display a block of lines
    without having to "echo" each individual line?

    Thanks!

    Ken

    Yes, it's called "here document"

    cat <<- ET
    Arbitrary text, and
    as many
    lines as you wish,
    until the final marker
    that I named ET in this
    case.
    ET

    If you don't want variables $var etc. to get expanded within the
    "here document" use this form

    cat <<- \ET
    You will get $HME as '$HME' and nothing else.
    ET

    Janis
  • No.3 | | 219 bytes | |

    kk_oop@yahoo.com wrote:
    Hi. In a Bourne script, is there a way to display a block of lines
    without having to "echo" each individual line?
    Thanks!
    Ken
    echo "abcd
    efgh
    ijkl"

Re: Display a block of lines?


max 4000 letters.
Your nickname that display:
In order to stop the spam: 1 + 1 =
QUESTION ON "Unix/Linux"

EMSDN.COM