Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

shell scripting basics



I'm trying to learn shell scripting with the examples provided in the
zsh distribution but some things I've not been able to figure out:

- How to read standard input line-by-line inside a script?
    
    For example if the script test.sh is invoked as 
    "cat README | test.sh"
    How do I get a handle to the standard input without using 'cat'
    inside the script?

    for i in $(<standard input>) do 
        <something with line>
    done

- How to store the output of a function in a scalar?

    function hashcode() {
        return $[$1 * $2]
    }
    scalar=`eval hashcode(param1, param2)`
   
   but that doesn't work.
   
Thanks in advance for suggestions.

-- 
Louis-David Mitterrand
http://www.aparima.com
mito@xxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author