Bourne shell: read variable from stdin - SUN

This is a discussion on Bourne shell: read variable from stdin - SUN ; Hi! I'm trying to read the variable from the stdin in the bourne shell script like: #! /bin/sh echo "haha\\\n" | read directory_fix echo "$directory_fix" but has null output. Does anybody know how to solve this? Thank you in advance, ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Bourne shell: read variable from stdin

  1. Bourne shell: read variable from stdin

    Hi!

    I'm trying to read the variable from the stdin in the bourne shell script
    like:

    #! /bin/sh
    echo "haha\\\n" | read directory_fix
    echo "$directory_fix"

    but has null output. Does anybody know how to solve this?

    Thank you in advance,
    Timur Valiulin.






  2. Re: Bourne shell: read variable from stdin

    In article ,
    Timur Valiulin wrote:
    >I'm trying to read the variable from the stdin in the bourne shell script
    >like:


    See the answer that someone already posted in comp.sys.sun.admin, and stop
    multi-posting.

    --
    Barry Margolin, barry.margolin@level3.com
    Level(3), Woburn, MA
    *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
    Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

+ Reply to Thread