Hi Igor,
igor denisov wrote on Mon, Aug 08, 2011 at 02:39:23PM +0400:
> I am not sure if it a bug,
It looks like a copy-and-paste bugs in your script.
> read_line: ./num.sh[23]: $: not found
Run hexdump -C on your script.
I see this, for example:
00000000 23 21 2f 62 69 6e 2f 6b 73 68 0a 49 4e 46 49 4c |#!/bin/ksh.INFIL|
00000010 45 4e 55 4d 3d 24 31 0a 0a 66 75 6e 63 74 69 6f |ENUM=$1..functio|
00000020 6e 20 72 65 61 64 5f 6c 69 6e 65 20 20 7b 0a 20 |n read_line {. |
00000030 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | |
*
00000070 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 0a | $.|
00000080 23 20 41 73 73 6f 63 69 61 74 65 20 73 74 61 6e |# Associate stan|
And this:
000000d0 74 6f 20 24 49 4e 46 49 4c 45 4e 55 4d 20 0a 24 |to $INFILENUM .$|
000000e0 0a 0a 65 78 65 63 20 34 3c 26 30 0a 65 78 65 63 |..exec 4<&0.exec|
If you put a dollar sign at the end of a line, no matter whether
there are lots of blanks before it or not, you need not wonder that
the shell tries to interpret the dollar sign as code.
Yours,
Ingo