ksh - help with getting one output

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dusoo
    New Member
    • Sep 2007
    • 1

    ksh - help with getting one output

    Hi all, im bit new to unix,
    and now im trying to get one output of one varieble in a function (ksh script), but it seems to have problems with pipe character or maybe a space. Could u please give me some advice how to get through this?
    thanks


    MONITOR()
    {
    grep_rule=$1
    echo "grep_rule= $1"
    # in the output i get correctly the string : ./hob status | grep small | wc -l

    # now i need to run it, to get the output of it, so i do this
    TMP=`"$grep_rul e"`
    echo $TMP
    # now it writes following error:./hob status | grep small | wc -l: No such file or
    directory

    # if i try the same string without double quotes
    TMP=`$grep_rule `
    echo $TMP
    # i get only output if i would run only ./hob status
    #... and that's wierd for me at least
    }
    GREP_RULE="./hob status | grep small | wc -l"
    MONITOR "$GREP_RULE "
Working...