#1
  1. cave painting, the 1st Opn Src
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2003
    Posts
    532
    Rep Power
    0

    KSH scripting - variable won't display


    In a script I have this:
    while read line
    do
    a="$line"
    echo $a "SECCLASSS PRD "
    done < "./xfiles.txt"

    and the $a will not output,
    but if I do this: echo "SECCLASSS PRD " $a
    it works.

    Why is the variable not working before the text:
    Curious by Nature,
    Linux by Choice
    Lawson ERP reference tools: Lawsuss.com
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,400
    Rep Power
    1688
    Puzzling ... what are the contents of the file?
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  4. #3
  5. cave painting, the 1st Opn Src
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2003
    Posts
    532
    Rep Power
    0
    At this point simple file names, one per line.

    If I manually input this on cmd line, it works correctly
    Curious by Nature,
    Linux by Choice
    Lawson ERP reference tools: Lawsuss.com

IMN logo majestic logo threadwatch logo seochat tools logo